Examples of BlackVolatilitySurfaceMoneyness


Examples of com.opengamma.analytics.financial.model.volatility.surface.BlackVolatilitySurfaceMoneyness

    final double[][] res = new double[n][];
    for (int i = 0; i < n; i++) {
      final int m = strikes[i].length;
      res[i] = new double[m];
      for (int j = 0; j < m; j++) {
        final BlackVolatilitySurfaceMoneyness bumpedSurface = _surfaceInterpolator.getBumpedVolatilitySurface(marketData, i, j, SHIFT);
        final LocalVolatilitySurfaceMoneyness bumpedLV = _dupireCalculator.getLocalVolatility(bumpedSurface);
        final PDETerminalResults1D pdeResBumped = _pdeCalculator.runPDESolver(bumpedLV, option);
        for (int k = 0; k < 4; k++) {
          vols[k] = BlackFormulaRepository.impliedVolatility(pdeResBumped.getFunctionValue(index + k), 1.0, moneyness[k],
              expiry, option.isCall());
View Full Code Here

Examples of com.opengamma.analytics.financial.model.volatility.surface.BlackVolatilitySurfaceMoneyness

    final double[][] res = new double[n][];
    for (int i = 0; i < n; i++) {
      final int m = strikes[i].length;
      res[i] = new double[m];
      for (int j = 0; j < m; j++) {
        final BlackVolatilitySurfaceMoneyness bumpedSurface = _surfaceInterpolator.getBumpedVolatilitySurface(marketData, i, j, SHIFT);
        final LocalVolatilitySurfaceMoneyness bumpedLV = _dupireCalculator.getLocalVolatility(bumpedSurface);
        final PDETerminalResults1D pdeResBumped = _pdeCalculator.runPDESolver(bumpedLV, option);
        for (int k = 0; k < 4; k++) {
          vols[k] = BlackFormulaRepository.impliedVolatility(pdeResBumped.getFunctionValue(index + k), 1.0, moneyness[k],
              expiry, option.isCall());
View Full Code Here

Examples of com.opengamma.analytics.financial.model.volatility.surface.BlackVolatilitySurfaceMoneyness

    final double[][] res = new double[n][];
    for (int i = 0; i < n; i++) {
      final int m = strikes[i].length;
      res[i] = new double[m];
      for (int j = 0; j < m; j++) {
        final BlackVolatilitySurfaceMoneyness bumpedSurface = _surfaceInterpolator.getBumpedVolatilitySurface(marketData, i, j, SHIFT);
        final LocalVolatilitySurfaceStrike bumpedLV = LocalVolatilitySurfaceConverter.toStrikeSurface(_dupireCalculator.getLocalVolatility(bumpedSurface));
        final PDETerminalResults1D pdeResBumped = _pdeCalculator.runPDESolver(bumpedLV, forwardCurve, option);
        for (int k = 0; k < 4; k++) {
          vols[k] = BlackFormulaRepository.impliedVolatility(pdeResBumped.getFunctionValue(index + k), fwds[k], option.getStrike(), expiry, option.isCall());
        }
View Full Code Here

Examples of com.opengamma.analytics.financial.model.volatility.surface.BlackVolatilitySurfaceMoneyness

    final double[][] res = new double[n][];
    for (int i = 0; i < n; i++) {
      final int m = strikes[i].length;
      res[i] = new double[m];
      for (int j = 0; j < m; j++) {
        final BlackVolatilitySurfaceMoneyness bumpedSurface = _surfaceInterpolator.getBumpedVolatilitySurface(marketData, i, j, SHIFT);
        final LocalVolatilitySurfaceStrike bumpedLV = LocalVolatilitySurfaceConverter.toStrikeSurface(_dupireCalculator.getLocalVolatility(bumpedSurface));
        final PDETerminalResults1D pdeResBumped = _pdeCalculator.runPDESolver(bumpedLV, forwardCurve, option);
        for (int k = 0; k < 4; k++) {
          vols[k] = BlackFormulaRepository.impliedVolatility(pdeResBumped.getFunctionValue(index + k), fwds[k], option.getStrike(), expiry, option.isCall());
        }
View Full Code Here

Examples of com.opengamma.analytics.financial.model.volatility.surface.BlackVolatilitySurfaceMoneyness

   */
  public double[] expectedVariance(final double spot, final YieldAndDiscountCurve discountCurve, final AffineDividends dividends, final double expiry,
      final BlackVolatilitySurfaceStrike volSurfaceStrike) {

    final EquityDividendsCurvesBundle divCurves = new EquityDividendsCurvesBundle(spot, discountCurve, dividends);
    final BlackVolatilitySurfaceMoneyness volSurface = BlackVolatilitySurfaceConverter.toMoneynessSurface(volSurfaceStrike, new ForwardCurve(divCurves.getF()));

    final double terminalFwd = divCurves.getF(expiry);
    final double logNoDivFwd = Math.log(spot) + discountCurve.getInterestRate(expiry) * expiry;
    final double logContract = integrate(getLogPayoffIntegrand(expiry, volSurface)) + Math.log(terminalFwd);

View Full Code Here

Examples of com.opengamma.analytics.financial.model.volatility.surface.BlackVolatilitySurfaceMoneyness

      }
    }

    //fit an implied volatility surface to the pure implied vols (as the forward is 1.0, the BlackVolatilitySurfaceMoneyness is numerically identical to the PureImpliedVolatilitySurface
    final SmileSurfaceDataBundle data = new StandardSmileSurfaceDataBundle(new ForwardCurve(1.0), marketVols.getExpiries(), x, pVols);
    final BlackVolatilitySurfaceMoneyness surf = _surfaceInterpolator.getVolatilitySurface(data);
    final PureImpliedVolatilitySurface pureSurf = new PureImpliedVolatilitySurface(surf.getSurface()); //TODO have a direct fitter for PureImpliedVolatilitySurface
    return pureSurf;
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.model.volatility.surface.BlackVolatilitySurfaceMoneyness

      }
    }

    //fit an implied volatility surface to the pure implied vols (as the forward is 1.0, the BlackVolatilitySurfaceMoneyness is numerically identical to the PureImpliedVolatilitySurface
    final SmileSurfaceDataBundle data = new StandardSmileSurfaceDataBundle(new ForwardCurve(1.0), expiries, x, vols);
    final BlackVolatilitySurfaceMoneyness surf = surfaceInterpolator.getVolatilitySurface(data);
    return new PureImpliedVolatilitySurface(surf.getSurface()); //TODO have a direct fitter for PureImpliedVolatilitySurface
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.model.volatility.surface.BlackVolatilitySurfaceMoneyness

      }
    }

    //fit an implied volatility surface to the pure implied vols (as the forward is 1.0, the BlackVolatilitySurfaceMoneyness is numerically identical to the PureImpliedVolatilitySurface
    final SmileSurfaceDataBundle data = new StandardSmileSurfaceDataBundle(new ForwardCurve(1.0), marketVols.getExpiries(), x, pVols);
    final BlackVolatilitySurfaceMoneyness surf = _surfaceInterpolator.getVolatilitySurface(data);
    final PureImpliedVolatilitySurface pureSurf = new PureImpliedVolatilitySurface(surf.getSurface()); //TODO have a direct fitter for PureImpliedVolatilitySurface
    return pureSurf;
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.model.volatility.surface.BlackVolatilitySurfaceMoneyness

    @Override
    public BlackVolatilitySurfaceMoneyness buildObject(final FudgeDeserializer deserializer, final FudgeMsg message) {
      final Object surface = deserializer.fieldValueToObject(message.getByName(SURFACE_FIELD_NAME));
      final Object forwardCurve = deserializer.fieldValueToObject(message.getByName(FORWARD_CURVE_FIELD_NAME));
      if (surface instanceof Surface) {
        return new BlackVolatilitySurfaceMoneyness((Surface<Double, Double, Double>) surface, (ForwardCurve) forwardCurve);
      }
      throw new OpenGammaRuntimeException("Expected Surface, got " + surface);
    }
View Full Code Here

Examples of com.opengamma.analytics.financial.model.volatility.surface.BlackVolatilitySurfaceMoneyness

      }
    };

    final BlackVolatilitySurfaceDelta surfaceDelta = new BlackVolatilitySurfaceDelta(FunctionalDoublesSurface.from(surf), FORWARD_CURVE);
    final BlackVolatilitySurfaceLogMoneyness surfaceLogMoneyness = BlackVolatilitySurfaceConverter.toLogMoneynessSurface(surfaceDelta);
    final BlackVolatilitySurfaceMoneyness surfaceMoneyness = BlackVolatilitySurfaceConverter.toMoneynessSurface(surfaceLogMoneyness);
    final BlackVolatilitySurfaceStrike surfaceStrike = BlackVolatilitySurfaceConverter.toStrikeSurface(surfaceLogMoneyness);

    final StaticReplicationDataBundle marketStrike = new StaticReplicationDataBundle(surfaceStrike, DISCOUNT, FORWARD_CURVE);
    final StaticReplicationDataBundle marketLogMoneyness = new StaticReplicationDataBundle(surfaceLogMoneyness, DISCOUNT, FORWARD_CURVE);
    final StaticReplicationDataBundle marketMoneyness = new StaticReplicationDataBundle(surfaceMoneyness, DISCOUNT, FORWARD_CURVE);
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.