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

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


    final double[] inSigmasX = {0.25, 0.7 };
    final double[] inSigmasY = {0.3, 0.5 };

    final double[] inWeights = {0.7, 0.3 };

    final MixedLogNormalModelData inObjX = new MixedLogNormalModelData(inWeights, inSigmasX, inRelativePartialForwardsX);
    final MixedLogNormalModelData inObjY = new MixedLogNormalModelData(inWeights, inSigmasY, inRelativePartialForwardsY);

    final double[] xx = new double[] {0.5, 0.7, 0.9, 1.0, 1.2, 1.5, 1.8, 0.5, 0.7, 0.9, 1.0, 1.2, 1.5, 1.8 };

    final MixedLogNormalVolatilityFunction volfunc = MixedLogNormalVolatilityFunction.getInstance();
    Arrays.fill(yy, 0.);

    for (int j = 0; j < nDataPtsX; ++j) {
      final EuropeanVanillaOption option = new EuropeanVanillaOption(xx[j], time, true);
      final double[] tmpRandNorm = objRandNorm.getVector(1);
      yyNoRand[j] = volfunc.getVolatility(option, fwdX, inObjX);
      yy[j] = yyNoRand[j] * (1. + tmpRandNorm[0]);
    }

    for (int j = nDataPtsX; j < nDataPts; ++j) {
      final EuropeanVanillaOption option = new EuropeanVanillaOption(xx[j], time, true);
      final double[] tmpRandNorm = objRandNorm.getVector(1);
      yyNoRand[j] = volfunc.getVolatility(option, fwdY, inObjY);
      yy[j] = yyNoRand[j] * (1. + tmpRandNorm[0]);
    }

    for (int j = 0; j < nDataPts; ++j) {
      System.out.println(yy[j] + "\t" + yyNoRand[j]);
    }

    final double[] rhos = new double[] {0.4, 0.4 };

    final MixedBivariateLogNormalModelVolatility objTrueZ = new MixedBivariateLogNormalModelVolatility(inWeights, inSigmasX,
        inSigmasY, inRelativePartialForwardsX, inRelativePartialForwardsY, rhos);

    //    final double[] inSigmasZ = objTrueZ.getSigmasZ();
    //    final double[] inRelativePartialForwardsZ = objTrueZ.getRelativeForwardsZ();

    System.out.println("true values: " + inSigmasX[0] + "\t" + inSigmasX[1]);
    System.out.println("\n");

    for (int i = 0; i < nParams; ++i) {
      aaGuess1[i] = 1e-2 + objRand.nextDouble();
    }
    MixedBivariateLogNormalFitter fitter1 = new MixedBivariateLogNormalFitter();

    boolean fitDone = false;

    while (fitDone == false) {

      for (int i = 0; i < nNorms; ++i) {
        aaGuess1X[i] = aaGuess1[i];
        aaGuess1Y[i] = aaGuess1[i + nNorms];
      }
      for (int i = 0; i < nNorms - 1; ++i) {
        aaGuess1X[i + nNorms] = aaGuess1[i + 2 * nNorms];
        aaGuess1X[i + 2 * nNorms - 1] = aaGuess1[i + 3 * nNorms - 1];
        aaGuess1Y[i + nNorms] = aaGuess1[i + 2 * nNorms];
        aaGuess1Y[i + 2 * nNorms - 1] = aaGuess1[i + 4 * nNorms - 2];
      }

      MixedLogNormalModelData tmpObj1X = new MixedLogNormalModelData(aaGuess1X, true);
      double[] tmpSigmasX = tmpObj1X.getVolatilities();

      System.out.println("guess: " + tmpSigmasX[0] + "\t" + tmpSigmasX[1]);
      fitter1.doFit(aaGuess1, xx, yy, time, fwdX, fwdY, nNorms, nDataPtsX, 1);
      aaGuess1 = fitter1.getParams();
      System.out.println("inintial sq: " + fitter1.getInitialSq());

      for (int i = 0; i < nNorms; ++i) {
        aaGuess1X[i] = aaGuess1[i];
        aaGuess1Y[i] = aaGuess1[i + nNorms];
      }
      for (int i = 0; i < nNorms - 1; ++i) {
        aaGuess1X[i + nNorms] = aaGuess1[i + 2 * nNorms];
        aaGuess1X[i + 2 * nNorms - 1] = aaGuess1[i + 3 * nNorms - 1];
        aaGuess1Y[i + nNorms] = aaGuess1[i + 2 * nNorms];
        aaGuess1Y[i + 2 * nNorms - 1] = aaGuess1[i + 4 * nNorms - 2];
      }

      tmpObj1X = new MixedLogNormalModelData(aaGuess1X, true);
      tmpSigmasX = tmpObj1X.getVolatilities();

      System.out.println("answer: " + tmpSigmasX[0] + "\t" + tmpSigmasX[1]);
      System.out.println("sq: " + fitter1.getFinalSq());
      System.out.println("\n");

      if (fitter1.getFinalSq() <= fitter1.getInitialSq() * 1e-6) {
        fitDone = true;
      } else {
        for (int i = 0; i < nParams; ++i) {
          aaGuess1[i] = 1e-2 + objRand.nextDouble();
        }
        fitter1 = new MixedBivariateLogNormalFitter();
      }

    }

    for (int i = 0; i < nNorms; ++i) {
      aaGuess1X[i] = aaGuess1[i];
      aaGuess1Y[i] = aaGuess1[i + nNorms];
    }
    for (int i = 0; i < nNorms - 1; ++i) {
      aaGuess1X[i + nNorms] = aaGuess1[i + 2 * nNorms];
      aaGuess1X[i + 2 * nNorms - 1] = aaGuess1[i + 3 * nNorms - 1];
      aaGuess1Y[i + nNorms] = aaGuess1[i + 2 * nNorms];
      aaGuess1Y[i + 2 * nNorms - 1] = aaGuess1[i + 4 * nNorms - 2];
    }

    final MixedLogNormalModelData objAns1X = new MixedLogNormalModelData(aaGuess1X, true);
    final double[] weights = objAns1X.getWeights();
    final double[] sigmasX = objAns1X.getVolatilities();
    final double[] relativePartialForwardsX = objAns1X.getRelativeForwards();

    final MixedLogNormalModelData objAns1Y = new MixedLogNormalModelData(aaGuess1Y, true);
    final double[] sigmasY = objAns1Y.getVolatilities();
    final double[] relativePartialForwardsY = objAns1Y.getRelativeForwards();

    final MixedBivariateLogNormalModelVolatility objZ = new MixedBivariateLogNormalModelVolatility(weights, sigmasX,
        sigmasY, relativePartialForwardsX, relativePartialForwardsY, rhos);

    //    final double[] sigmasZ = objZ.getSigmasZ();
View Full Code Here


        aaGuessX[i + 2 * nNorms - 1] = aaGuess[i + 3 * nNorms - 1];
        aaGuessY[i + nNorms] = aaGuess[i + 2 * nNorms];
        aaGuessY[i + 2 * nNorms - 1] = aaGuess[i + 4 * nNorms - 2];
      }

      MixedLogNormalModelData tmpObj1X = new MixedLogNormalModelData(aaGuessX, true);
      double[] tmpSigmasX = tmpObj1X.getVolatilities();

      System.out.println("guess: " + tmpSigmasX[0] + "\t" + tmpSigmasX[1]);
      fitter1.doFit(aaGuess, xx, yy, time, fwdX, fwdY, nNorms, nDataPtsX, 1);
      aaGuess = fitter1.getParams();
      System.out.println("inintial sq: " + fitter1.getInitialSq());

      for (int i = 0; i < nNorms; ++i) {
        aaGuessX[i] = aaGuess[i];
        aaGuessY[i] = aaGuess[i + nNorms];
      }
      for (int i = 0; i < nNorms - 1; ++i) {
        aaGuessX[i + nNorms] = aaGuess[i + 2 * nNorms];
        aaGuessX[i + 2 * nNorms - 1] = aaGuess[i + 3 * nNorms - 1];
        aaGuessY[i + nNorms] = aaGuess[i + 2 * nNorms];
        aaGuessY[i + 2 * nNorms - 1] = aaGuess[i + 4 * nNorms - 2];
      }

      tmpObj1X = new MixedLogNormalModelData(aaGuessX, true);
      tmpSigmasX = tmpObj1X.getVolatilities();

      System.out.println("answer: " + tmpSigmasX[0] + "\t" + tmpSigmasX[1]);
      System.out.println("sq: " + fitter1.getFinalSq());
      System.out.println("\n");

      if (fitter1.getFinalSq() <= fitter1.getInitialSq() * 1e-10) {
        fitDone = true;
      } else {
        for (int i = 0; i < nParams; ++i) {
          aaGuess[i] = 1e-2 + objRand.nextDouble();
        }
        fitter1 = new MixedBivariateLogNormalFitter();
      }

    }

    for (int i = 0; i < nNorms; ++i) {
      aaGuessX[i] = aaGuess[i];
      aaGuessY[i] = aaGuess[i + nNorms];
    }
    for (int i = 0; i < nNorms - 1; ++i) {
      aaGuessX[i + nNorms] = aaGuess[i + 2 * nNorms];
      aaGuessX[i + 2 * nNorms - 1] = aaGuess[i + 3 * nNorms - 1];
      aaGuessY[i + nNorms] = aaGuess[i + 2 * nNorms];
      aaGuessY[i + 2 * nNorms - 1] = aaGuess[i + 4 * nNorms - 2];
    }

    final MixedLogNormalModelData objAns1X = new MixedLogNormalModelData(aaGuessX, true);
    final double[] weights = objAns1X.getWeights();
    final double[] sigmasX = objAns1X.getVolatilities();
    final double[] relativePartialForwardsX = objAns1X.getRelativeForwards();

    final MixedLogNormalModelData objAns1Y = new MixedLogNormalModelData(aaGuessY, true);
    final double[] sigmasY = objAns1Y.getVolatilities();
    final double[] relativePartialForwardsY = objAns1Y.getRelativeForwards();

    final MixedBivariateLogNormalModelVolatility objZ = new MixedBivariateLogNormalModelVolatility(weights, sigmasX,
        sigmasY, relativePartialForwardsX, relativePartialForwardsY, rhos);

    final double[] sigmasZ = objZ.getSigmasZ();
View Full Code Here

      aaGuessX[i + 2 * nNorms - 1] = aaGuess[i + 3 * nNorms - 1];
      aaGuessY[i + nNorms] = aaGuess[i + 2 * nNorms];
      aaGuessY[i + 2 * nNorms - 1] = aaGuess[i + 4 * nNorms - 2];
    }

    final MixedLogNormalModelData objAns1X = new MixedLogNormalModelData(aaGuessX, true);
    final double[] weights = objAns1X.getWeights();
    final double[] sigmasX = objAns1X.getVolatilities();
    final double[] relativePartialForwardsX = objAns1X.getRelativeForwards();

    final MixedLogNormalModelData objAns1Y = new MixedLogNormalModelData(aaGuessY, true);
    final double[] sigmasY = objAns1Y.getVolatilities();
    final double[] relativePartialForwardsY = objAns1Y.getRelativeForwards();

    final Random randObj = new Random();

    for (int i = 0; i < nNorms; ++i) {
      rhosGuess[i] = 1. - randObj.nextDouble();
View Full Code Here

      paramsX[i + 2 * nNorms - 1] = params[i + 3 * nNorms - 1];
      paramsY[i + nNorms] = params[i + 2 * nNorms];
      paramsY[i + 2 * nNorms - 1] = params[i + 4 * nNorms - 2];
    }

    final MixedLogNormalModelData inObjX = new MixedLogNormalModelData(paramsX, true);
    final MixedLogNormalModelData inObjY = new MixedLogNormalModelData(paramsY, true);

    final double[] relativePartialForwardsX = inObjX.getRelativeForwards();
    final double[] sigmasX = inObjX.getVolatilities();

    final double[] relativePartialForwardsY = inObjY.getRelativeForwards();
    final double[] sigmasY = inObjY.getVolatilities();

    final double[] weights = inObjX.getWeights();

    Arrays.fill(yy, 0.);

View Full Code Here

    for (int i = 0; i < nNormals - 1; ++i) {
      paramsY[i + nNormals] = params[i + 2 * nNormals];
      paramsY[i + 2 * nNormals - 1] = params[i + 4 * nNormals - 2];
    }

    final MixedLogNormalModelData dataX = new MixedLogNormalModelData(paramsX, true);
    final MixedLogNormalModelData dataY = new MixedLogNormalModelData(paramsY, true);

    final double[] res = new double[nData];
    Arrays.fill(res, 0.);

    for (int j = 0; j < nDataX; ++j) {
View Full Code Here

    final MixedBivariateLogNormalModelVolatility guessObjZ = new MixedBivariateLogNormalModelVolatility(wghts, sigsX, sigsY, rpfsX, rpfsY, rhos);
    final double[] sigmasZ = guessObjZ.getSigmasZ();
    final double[] relativePartialForwardsZ = guessObjZ.getRelativeForwardsZ();
    final double[] weightsZ = guessObjZ.getOrderedWeights();
    final MixedLogNormalModelData guessDataZ = new MixedLogNormalModelData(weightsZ, sigmasZ, relativePartialForwardsZ);

    for (int j = 0; j < nData; ++j) {
      final EuropeanVanillaOption option = new EuropeanVanillaOption(dataStrs[j], time, true);
      res[j] = dataVols[j] - getVolatility(option, forwardZ, guessDataZ);
    }
View Full Code Here

    final MixedBivariateLogNormalModelVolatility guessObjZ = new MixedBivariateLogNormalModelVolatility(wghts, sigsX, sigsY, rpfsX, rpfsY, rhos);
    final double[] sigmasZ = guessObjZ.getSigmasZ();
    final double[] relativePartialForwardsZ = guessObjZ.getRelativeForwardsZ();
    final double[] weightsZ = guessObjZ.getOrderedWeights();
    final double correction = guessObjZ.getInvExpDriftCorrection();
    final MixedLogNormalModelData guessDataZ = new MixedLogNormalModelData(weightsZ, sigmasZ, relativePartialForwardsZ);

    final double[] sigmasX = guessObjZ.getOrderedSigmasX();
    final double[] sigmasY = guessObjZ.getOrderedSigmasY();

    for (int j = 0; j < nData; ++j) {
View Full Code Here

    final double[] inSigmasX = {0.25, 0.7 };
    final double[] inSigmasY = {0.3, 0.5 };

    final double[] inWeights = {0.7, 0.3 };

    final MixedLogNormalModelData inObjX = new MixedLogNormalModelData(inWeights, inSigmasX, inRelativePartialForwardsX);
    final MixedLogNormalModelData inObjY = new MixedLogNormalModelData(inWeights, inSigmasY, inRelativePartialForwardsY);

    final double[] xx = new double[] {0.9, 0.95, 1.0, 1.05, 1.1, 0.9, 0.95, 1.0, 1.05, 1.15 };

    final MixedLogNormalVolatilityFunction volfunc = MixedLogNormalVolatilityFunction.getInstance();
    Arrays.fill(yy, 0.);

    for (int j = 0; j < nDataPtsX; ++j) {
      final EuropeanVanillaOption option = new EuropeanVanillaOption(xx[j], time, true);
      yy[j] = volfunc.getVolatility(option, fwdX, inObjX);
    }

    for (int j = nDataPtsX; j < nDataPts; ++j) {
      final EuropeanVanillaOption option = new EuropeanVanillaOption(xx[j], time, true);
      yy[j] = volfunc.getVolatility(option, fwdY, inObjY);
    }

    for (int i = 0; i < nParams; ++i) {
      aaGuess1[i] = 0.5;
    }
    final MixedBivariateLogNormalFitter fitter1 = new MixedBivariateLogNormalFitter();

    for (int i = 0; i < nNorms; ++i) {
      aaGuess1X[i] = aaGuess1[i];
      aaGuess1Y[i] = aaGuess1[i + nNorms];
    }
    for (int i = 0; i < nNorms - 1; ++i) {
      aaGuess1X[i + nNorms] = aaGuess1[i + 2 * nNorms];
      aaGuess1X[i + 2 * nNorms - 1] = aaGuess1[i + 3 * nNorms - 1];
      aaGuess1Y[i + nNorms] = aaGuess1[i + 2 * nNorms];
      aaGuess1Y[i + 2 * nNorms - 1] = aaGuess1[i + 4 * nNorms - 2];
    }

    fitter1.doFit(aaGuess1, xx, yy, time, fwdX, fwdY, nNorms, nDataPtsX, 1);
    aaGuess1 = fitter1.getParams();

    for (int i = 0; i < nNorms; ++i) {
      aaGuess1X[i] = aaGuess1[i];
      aaGuess1Y[i] = aaGuess1[i + nNorms];
    }
    for (int i = 0; i < nNorms - 1; ++i) {
      aaGuess1X[i + nNorms] = aaGuess1[i + 2 * nNorms];
      aaGuess1X[i + 2 * nNorms - 1] = aaGuess1[i + 3 * nNorms - 1];
      aaGuess1Y[i + nNorms] = aaGuess1[i + 2 * nNorms];
      aaGuess1Y[i + 2 * nNorms - 1] = aaGuess1[i + 4 * nNorms - 2];
    }

    for (int i = 0; i < nNorms; ++i) {
      aaGuess1X[i] = aaGuess1[i];
      aaGuess1Y[i] = aaGuess1[i + nNorms];
    }
    for (int i = 0; i < nNorms - 1; ++i) {
      aaGuess1X[i + nNorms] = aaGuess1[i + 2 * nNorms];
      aaGuess1X[i + 2 * nNorms - 1] = aaGuess1[i + 3 * nNorms - 1];
      aaGuess1Y[i + nNorms] = aaGuess1[i + 2 * nNorms];
      aaGuess1Y[i + 2 * nNorms - 1] = aaGuess1[i + 4 * nNorms - 2];
    }

    final MixedLogNormalModelData objAns1X = new MixedLogNormalModelData(aaGuess1X, true);
    final double[] weights = objAns1X.getWeights();
    final double[] sigmasX = objAns1X.getVolatilities();
    final double[] relativePartialForwardsX = objAns1X.getRelativeForwards();

    final MixedLogNormalModelData objAns1Y = new MixedLogNormalModelData(aaGuess1Y, true);
    final double[] sigmasY = objAns1Y.getVolatilities();
    final double[] relativePartialForwardsY = objAns1Y.getRelativeForwards();

    for (int i = 0; i < nNorms; ++i) {

      assertEquals(weights[i], inWeights[i], Math.abs((inWeights[0] + inWeights[1]) / 2.) * 1e-9);
    }
View Full Code Here

    for (int i = 0; i < nNorms - 1; ++i) {
      aaX[i + nNorms] = aaGuess2[i + 2 * nNorms];
      aaX[i + 2 * nNorms - 1] = aaGuess2[i + 3 * nNorms - 1];
    }

    final MixedLogNormalModelData objAns1 = new MixedLogNormalModelData(aaGuessX, true);
    final MixedLogNormalModelData objAns2 = new MixedLogNormalModelData(aaX, true);
    final MixedLogNormalVolatilityFunction volfunc = MixedLogNormalVolatilityFunction.getInstance();

    for (int i = 0; i < 100; i++) {
      final double k = fwdX * (0.5 + 1. * i / 100.);
      final EuropeanVanillaOption option = new EuropeanVanillaOption(k, time, true);
View Full Code Here

    final double[] inSigmasX = {0.25, 0.7 };
    final double[] inSigmasY = {0.3, 0.5 };

    final double[] inWeights = {0.7, 0.3 };

    final MixedLogNormalModelData inObjX = new MixedLogNormalModelData(inWeights, inSigmasX, inRelativePartialForwardsX);
    final MixedLogNormalModelData inObjY = new MixedLogNormalModelData(inWeights, inSigmasY, inRelativePartialForwardsY);

    xx = new double[] {0.5, 0.7, 0.9, 1.0, 1.2, 1.5, 1.8, 0.5, 0.7, 0.9, 1.0, 1.2, 1.5, 1.8 };

    final MixedLogNormalVolatilityFunction volfunc = MixedLogNormalVolatilityFunction.getInstance();
    Arrays.fill(yy, 0.);

    for (int j = 0; j < nDataPtsX; ++j) {
      final EuropeanVanillaOption option = new EuropeanVanillaOption(xx[j], time, true);
      yy[j] = volfunc.getVolatility(option, fwdX, inObjX);
    }

    for (int j = nDataPtsX; j < nDataPts; ++j) {
      final EuropeanVanillaOption option = new EuropeanVanillaOption(xx[j], time, true);
      yy[j] = volfunc.getVolatility(option, fwdY, inObjY);
    }

    rhos[0] = 0.2;
    rhos[1] = 0.9;

    final MixedBivariateLogNormalModelVolatility objTrueZ = new MixedBivariateLogNormalModelVolatility(inWeights, inSigmasX,
        inSigmasY, inRelativePartialForwardsX, inRelativePartialForwardsY, rhos);

    final double[] inSigmasZ = objTrueZ.getSigmasZ();
    final double[] inRelativePartialForwardsZ = objTrueZ.getRelativeForwardsZ();

    System.out.println("true values: " + inSigmasX[0] + "\t" + inSigmasX[1]);
    System.out.println("\n");

    for (int i = 0; i < nParams; ++i) {
      aaGuess1[i] = 1e-2 + obj.nextDouble();
    }
    MixedBivariateLogNormalFitter fitter1 = new MixedBivariateLogNormalFitter();

    boolean fitDone = false;

    while (fitDone == false) {

      for (int i = 0; i < nNorms; ++i) {
        aaGuess1X[i] = aaGuess1[i];
        aaGuess1Y[i] = aaGuess1[i + nNorms];
      }
      for (int i = 0; i < nNorms - 1; ++i) {
        aaGuess1X[i + nNorms] = aaGuess1[i + 2 * nNorms];
        aaGuess1X[i + 2 * nNorms - 1] = aaGuess1[i + 3 * nNorms - 1];
        aaGuess1Y[i + nNorms] = aaGuess1[i + 2 * nNorms];
        aaGuess1Y[i + 2 * nNorms - 1] = aaGuess1[i + 4 * nNorms - 2];
      }

      MixedLogNormalModelData tmpObj1X = new MixedLogNormalModelData(aaGuess1X, true);
      double[] tmpSigmasX = tmpObj1X.getVolatilities();

      System.out.println("guess: " + tmpSigmasX[0] + "\t" + tmpSigmasX[1]);
      fitter1.doFit(aaGuess1, xx, yy, time, fwdX, fwdY, nNorms, nDataPtsX, 1);
      aaGuess1 = fitter1.getParams();
      System.out.println("inintial sq: " + fitter1.getInitialSq());

      for (int i = 0; i < nNorms; ++i) {
        aaGuess1X[i] = aaGuess1[i];
        aaGuess1Y[i] = aaGuess1[i + nNorms];
      }
      for (int i = 0; i < nNorms - 1; ++i) {
        aaGuess1X[i + nNorms] = aaGuess1[i + 2 * nNorms];
        aaGuess1X[i + 2 * nNorms - 1] = aaGuess1[i + 3 * nNorms - 1];
        aaGuess1Y[i + nNorms] = aaGuess1[i + 2 * nNorms];
        aaGuess1Y[i + 2 * nNorms - 1] = aaGuess1[i + 4 * nNorms - 2];
      }

      tmpObj1X = new MixedLogNormalModelData(aaGuess1X, true);
      tmpSigmasX = tmpObj1X.getVolatilities();

      System.out.println("answer: " + tmpSigmasX[0] + "\t" + tmpSigmasX[1]);
      System.out.println("sq: " + fitter1.getFinalSq());
      System.out.println("\n");

      if (fitter1.getFinalSq() <= fitter1.getInitialSq() * 1e-10) {
        fitDone = true;
      } else {
        for (int i = 0; i < nParams; ++i) {
          aaGuess1[i] = 1e-2 + obj.nextDouble();
        }
        fitter1 = new MixedBivariateLogNormalFitter();
      }

    }

    for (int i = 0; i < nNorms; ++i) {
      aaGuess1X[i] = aaGuess1[i];
      aaGuess1Y[i] = aaGuess1[i + nNorms];
    }
    for (int i = 0; i < nNorms - 1; ++i) {
      aaGuess1X[i + nNorms] = aaGuess1[i + 2 * nNorms];
      aaGuess1X[i + 2 * nNorms - 1] = aaGuess1[i + 3 * nNorms - 1];
      aaGuess1Y[i + nNorms] = aaGuess1[i + 2 * nNorms];
      aaGuess1Y[i + 2 * nNorms - 1] = aaGuess1[i + 4 * nNorms - 2];
    }

    final MixedLogNormalModelData objAns1X = new MixedLogNormalModelData(aaGuess1X, true);
    final double[] weights = objAns1X.getWeights();
    final double[] sigmasX = objAns1X.getVolatilities();
    final double[] relativePartialForwardsX = objAns1X.getRelativeForwards();

    final MixedLogNormalModelData objAns1Y = new MixedLogNormalModelData(aaGuess1Y, true);
    final double[] sigmasY = objAns1Y.getVolatilities();
    final double[] relativePartialForwardsY = objAns1Y.getRelativeForwards();

    final MixedBivariateLogNormalModelVolatility objZ = new MixedBivariateLogNormalModelVolatility(weights, sigmasX,
        sigmasY, relativePartialForwardsX, relativePartialForwardsY, rhos);

    final double[] sigmasZ = objZ.getSigmasZ();
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.