Package com.opengamma.analytics.financial.equity.variance.pricing

Examples of com.opengamma.analytics.financial.equity.variance.pricing.EquityVarianceSwapBackwardsPurePDE


    }
    double temp = Math.sqrt(2 * (Math.log(sum1) - sum2) / t);
    System.out.println("expected: " + temp);

    PureLocalVolatilitySurface plv = VolatilitySurfaceConverter.convertLocalVolSurface(lv2, new EquityDividendsCurvesBundle(spot, discountCurve, AffineDividends.noDividends()));
    EquityVarianceSwapBackwardsPurePDE backCal = new EquityVarianceSwapBackwardsPurePDE();
    res = backCal.expectedVariance(spot, discountCurve, AffineDividends.noDividends(), t, plv);
    System.out.println(Math.sqrt(res[0] / t));

    double vol = lvs.getVolatility(0.0, 25.0);
    System.out.println(vol);
  }
View Full Code Here


    //test the new backwards local vol method for expected variance
    final YieldAndDiscountCurve yieldCurve = new YieldCurve("test", ConstantDoublesCurve.from(DRIFT));
    final AffineDividends ad = AffineDividends.noDividends();

    final EquityVarianceSwapBackwardsPurePDE backSolver = new EquityVarianceSwapBackwardsPurePDE();
    final PureLocalVolatilitySurface plv = new PureLocalVolatilitySurface(ConstantDoublesSurface.from(FLAT_VOL));

    final double[] res2 = backSolver.expectedVariance(SPOT, yieldCurve, ad, EXPIRY, plv);
    final double kVol2 = Math.sqrt(res2[0] / EXPIRY);
    assertEquals(FLAT_VOL, kVol2, 1e-6);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.equity.variance.pricing.EquityVarianceSwapBackwardsPurePDE

Copyright © 2018 www.massapicom. 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.