Package com.opengamma.analytics.financial.model.volatility.smile.function

Examples of com.opengamma.analytics.financial.model.volatility.smile.function.MultiHorizonMixedLogNormalModelData


    final double[] sigma = new double[] {0.3, 0.6, 1.0 };
    final double[] mu = new double[] {0.0, 0.3, -0.5 };
    //    double[] w = new double[] {0.99, 0.01, 0.0000};
    //    double[] sigma = new double[] {0.3, 0.5, 0.8};
    //  double[] mu = new double[] {0.0, 0.0, -0.0};
    final MultiHorizonMixedLogNormalModelData data = new MultiHorizonMixedLogNormalModelData(w, sigma, mu);
    final PriceSurface priceSurf = MixedLogNormalVolatilitySurface.getPriceSurface(FWD_CURVE, DIS_CURVE, data);
    final LocalVolatilitySurfaceStrike locVol = MixedLogNormalVolatilitySurface.getLocalVolatilitySurface(FWD_CURVE, data);

    final double k = 14.0;
    final boolean isCall = true;
View Full Code Here


    final ForwardCurve fc = new ForwardCurve(spot, r);
    final YieldAndDiscountCurve discountCurve = new YieldCurve("test", ConstantDoublesCurve.from(r));
    double[] w = new double[] {0.7, 0.25, 0.05 };
    double[] sigma = new double[] {0.3, 0.6, 1.0 };
    double[] mu = new double[] {0.0, 0.3, -0.5 };
    MultiHorizonMixedLogNormalModelData data = new MultiHorizonMixedLogNormalModelData(w, sigma, mu);
    BlackVolatilitySurfaceStrike ivs = MixedLogNormalVolatilitySurface.getImpliedVolatilitySurface(fc, data);
    PDEUtilityTools.printSurface("imp vol", ivs.getSurface(), 0.01, 2.0, spot * 0.1, spot * 3.0);

    LocalVolatilitySurfaceStrike lvs = MixedLogNormalVolatilitySurface.getLocalVolatilitySurface(fc, data);
    PDEUtilityTools.printSurface("local vol", lvs.getSurface(), 0.00, 2.0, spot * 0.1, spot * 3.0);
 
View Full Code Here

    final double r = 0.05;
    final ForwardCurve fc = new ForwardCurve(spot, r);
    final double vol = 0.3;
    double[] w = new double[] {0.6, 0.4 };
    double[] sigma = new double[] {vol, vol };
    MultiHorizonMixedLogNormalModelData data = new MultiHorizonMixedLogNormalModelData(w, sigma);
    BlackVolatilitySurfaceStrike ivs = MixedLogNormalVolatilitySurface.getImpliedVolatilitySurface(fc, data);
    LocalVolatilitySurfaceStrike lvs = MixedLogNormalVolatilitySurface.getLocalVolatilitySurface(fc, data);
    for (int i = 0; i < 100; i++) {
      double t = 5.0 * RANDOM.nextDouble();
      //strikes in range +- 8-sigma
View Full Code Here

    final double r = 0.05;
    final ForwardCurve fc = new ForwardCurve(spot, r);
    final double vol = 0.3;
    double[] w = new double[] {0.8, 0.2 };
    double[] sigma = new double[] {0.2, 0.7 };
    MultiHorizonMixedLogNormalModelData data = new MultiHorizonMixedLogNormalModelData(w, sigma);
    BlackVolatilitySurfaceStrike ivs = MixedLogNormalVolatilitySurface.getImpliedVolatilitySurface(fc, data);
    LocalVolatilitySurfaceStrike lvs = MixedLogNormalVolatilitySurface.getLocalVolatilitySurface(fc, data);
    LocalVolatilitySurfaceStrike lvs2 = dupire.getLocalVolatility(ivs, fc);

    for (int i = 0; i < 100; i++) {
View Full Code Here

    final double vol = 0.3;
    double[] w = new double[] {0.9, 0.1 };
    double[] sigma = new double[] {0.2, 0.7 };
    double[] mu = new double[] {0.1, -0.1 };

    MultiHorizonMixedLogNormalModelData data = new MultiHorizonMixedLogNormalModelData(w, sigma, mu);
    BlackVolatilitySurfaceStrike ivs = MixedLogNormalVolatilitySurface.getImpliedVolatilitySurface(fc, data);
    LocalVolatilitySurfaceStrike lvs = MixedLogNormalVolatilitySurface.getLocalVolatilitySurface(fc, data);
    LocalVolatilitySurfaceStrike lvs2 = dupire.getLocalVolatility(ivs, fc);

    for (int i = 0; i < 100; i++) {
View Full Code Here

    //set up the mixed log-normal model
    final double[] weights = new double[] {0.1, 0.8, 0.1 };
    final double[] sigmas = new double[] {0.15, 0.5, 0.9 };
    final double[] mus = new double[] {-0.1, 0, 0.1 };

    final MultiHorizonMixedLogNormalModelData mlnData = new MultiHorizonMixedLogNormalModelData(weights, sigmas, mus);
    final double spot = 100.;
    final double r = 0.1;
    final ForwardCurve fwdCurve = new ForwardCurve(spot, r);

    final double t = 1.0 / 365.;
View Full Code Here

    final YieldAndDiscountCurve discountCurve = new YieldCurve("test", ConstantDoublesCurve.from(r));
    final double[] w = new double[] {0.7, 0.25, 0.05 };
    final double[] sigma = new double[] {0.3, 0.6, 1.0 };
    final double[] mu = new double[] {0.0, 0.3, -0.5 };

    final MultiHorizonMixedLogNormalModelData data = new MultiHorizonMixedLogNormalModelData(w, sigma, mu);
    final LocalVolatilitySurfaceStrike lv = MixedLogNormalVolatilitySurface.getLocalVolatilitySurface(fc, data);

    //TODO relatively large grid needed for moderate accuracy
    final int tN = 400;
    final int sN = 2 * tN;
 
View Full Code Here

  @Test
  public void testMixedLogNormalVolSurface() {

    final double[] weights = new double[] {0.9, 0.1 };
    final double[] sigmas = new double[] {0.2, 0.8 };
    final MultiHorizonMixedLogNormalModelData data = new MultiHorizonMixedLogNormalModelData(weights, sigmas);
    final LocalVolatilitySurfaceStrike lv = MixedLogNormalVolatilitySurface.getLocalVolatilitySurface(FORWARD_CURVE, data);
    final LocalVolatilitySurfaceMoneyness lvm = LocalVolatilitySurfaceConverter.toMoneynessSurface(lv, FORWARD_CURVE);
    final double expected = Math.sqrt(weights[0] * sigmas[0] * sigmas[0] + weights[1] * sigmas[1] * sigmas[1]);

    final double ft = FORWARD_CURVE.getForward(EXPIRY);
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.model.volatility.smile.function.MultiHorizonMixedLogNormalModelData

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.