Examples of FFTModelGreeks


Examples of com.opengamma.analytics.financial.model.option.pricing.fourier.FFTModelGreeks

  @Override
  public Function1D<HestonModelData, double[][]> getVolatilityAdjointFunction(final double forward, final double[] strikes,
      final double timeToExpiry) {

    final FFTModelGreeks greekCal = new FFTModelGreeks();
    final int n = strikes.length;
    final double lowestStrike = strikes[0];
    final double highestStrike = strikes[n - 1];
    final double[][] nodeSense = new double[n][];

    return new Function1D<HestonModelData, double[][]>() {

      @SuppressWarnings("synthetic-access")
      @Override
      public double[][] evaluate(final HestonModelData x) {
        final MartingaleCharacteristicExponent ce = new HestonCharacteristicExponent(x);
        final double[][] greeks = greekCal.getGreeks(forward, 1.0, timeToExpiry, true, ce, lowestStrike, highestStrike, n, _limitSigma, _alpha, _limitTolerance);
        //1st array is strikes and the second is prices (which we don't need)
        final double[] k = greeks[0];
        final double[] prices = greeks[1];
        final int m = k.length;
        final double[] vols = new double[m];
View Full Code Here

Examples of com.opengamma.analytics.financial.model.option.pricing.fourier.FFTModelGreeks

  }

  @Override
  public Function1D<HestonModelData, double[][]> getModelAdjointFunction(final double forward, final double[] strikes,
      final double timeToExpiry) {
    final FFTModelGreeks greekCal = new FFTModelGreeks();
    final int n = strikes.length;
    final double lowestStrike = strikes[0];
    final double highestStrike = strikes[n - 1];
    final double[][] nodeSense = new double[n][];

    return new Function1D<HestonModelData, double[][]>() {

      @SuppressWarnings("synthetic-access")
      @Override
      public double[][] evaluate(final HestonModelData x) {
        final MartingaleCharacteristicExponent ce = new HestonCharacteristicExponent(x);
        final double[][] greeks = greekCal.getGreeks(forward, 1.0, timeToExpiry, true, ce, lowestStrike, highestStrike, n, _limitSigma, _alpha, _limitTolerance);
        //1st array is strikes and the second is prices (which we don't need)

        final double[] k = greeks[0];
        final double[] prices = greeks[1];
        final int m = k.length;
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.