final double[] capVols = getCapVols(i);
final CapletStrippingBootstrap bootstrap = new CapletStrippingBootstrap(caps, yieldCurve);
final double[] capletVols = bootstrap.capletVolsFromCapVols(capVols);
final MultiCapFloorPricer pricer = new MultiCapFloorPricer(caps, yieldCurve);
final VolatilityTermStructure volCurve = getPiecewise(capletVols,bootstrap.getEndTimes());
final double[] fittedCapVols = pricer.impliedVols(volCurve);
final int m = fittedCapVols.length;
if (print) {
for (int index = 0; index < nSamples; index++) {
final double t = index * 10.0 / (nSamples - 1);
curve[index][i] = volCurve.getVolatility(t);
}
}
for (int j = 0; j < m; j++) {
assertEquals(i + "\t" + j, capVols[j], fittedCapVols[j], 2e-9);