Examples of LocalVolatilitySurfaceStrike


Examples of com.opengamma.analytics.financial.model.volatility.local.LocalVolatilitySurfaceStrike

    final double k = 120.0;
    final double sigma = 0.4;
    final boolean isCall = true;
    final ForwardCurve fc = new ForwardCurve(spot, r);

    final LocalVolatilitySurfaceStrike lv = new LocalVolatilitySurfaceStrike(ConstantDoublesSurface.from(sigma));

    final int tN = 60;
    final int sN = 80 * tN;

    final double pdePrice = PRICER.price(spot, k, r, b, t, lv, true, false, sN, tN);
View Full Code Here

Examples of com.opengamma.analytics.financial.model.volatility.local.LocalVolatilitySurfaceStrike

    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

Examples of com.opengamma.analytics.financial.model.volatility.local.LocalVolatilitySurfaceStrike

  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);
    final double theta = 0.5;
View Full Code Here

Examples of com.opengamma.analytics.financial.model.volatility.local.LocalVolatilitySurfaceStrike

    final Object localVolatilityObject = inputs.getValue(volatilitySurfaceRequirement);
    if (localVolatilityObject == null) {
      throw new OpenGammaRuntimeException("Could not get local volatility surface");
    }
    final LocalVolatilitySurfaceMoneyness localVolatilityMoneyness = (LocalVolatilitySurfaceMoneyness) localVolatilityObject;
    final LocalVolatilitySurfaceStrike localVolatilityStrike = LocalVolatilitySurfaceConverter.toStrikeSurface(localVolatilityMoneyness);
    final ValueProperties properties = getResultProperties(desiredValue, LocalVolatilitySurfacePropertyNamesAndValues.STRIKE);
    final ValueSpecification spec = new ValueSpecification(ValueRequirementNames.LOCAL_VOLATILITY_SURFACE, target.toSpecification(), properties);
    return Collections.singleton(new ComputedValue(spec, localVolatilityStrike));
  }
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.