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

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


    errors[1] = 1e-1;
    final SmileModelFitter<MixedLogNormalModelData> fitter = new MixedLogNormalModelFitter(forward, strikes, expiry, impVols, errors, MODEL, 2, true);
    final DoubleMatrix1D start = new DoubleMatrix1D(0.15, 0.1, 0.5, 0.5);
    final LeastSquareResultsWithTransform lsres = fitter.solve(start);
    System.out.println(lsres.toString());
    final MixedLogNormalModelData data = new MixedLogNormalModelData(lsres.getModelParameters().getData());
    System.out.println(data.toString());
    for (int i = 0; i < 200; i++) {
      final double k = 700 + 1300 * i / 199.;
      final double vol = MODEL.getVolatility(new EuropeanVanillaOption(k, expiry, true), forward, data);
      System.out.println(k + "\t" + vol);
    }
View Full Code Here


    return new UncoupledParameterTransforms(start, _transforms, fixed);
  }

  @Override
  protected MixedLogNormalModelData toSmileModelData(final DoubleMatrix1D modelParameters) {
    return new MixedLogNormalModelData(modelParameters.getData(), _useShiftedMean);
  }
View Full Code Here

    // DoubleMatrix1D start = new DoubleMatrix1D(0.1653806454982462, 0.2981998932366687, 1.298321083180569, 0.16115590666749585);
    //  best = fitter.solve(start);
    if (best != null) {
      System.out.println(best.toString());
      final MixedLogNormalModelData data = new MixedLogNormalModelData(best.getModelParameters().getData());
      System.out.println(data.toString());
      for (int i = 0; i < 200; i++) {
        final double k = 500 + 1700 * i / 199.;

        final EuropeanVanillaOption option = new EuropeanVanillaOption(k, expiry, true);
        final double vol = model.getVolatility(option, forward, data);
View Full Code Here

TOP

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

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.