Examples of VolatilityTermStructure


Examples of com.opengamma.analytics.financial.model.volatility.VolatilityTermStructure

      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);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.