Class DupireLocalVolatility

java.lang.Object
net.finmath.marketdata.model.volatilities.DupireLocalVolatility
All Implemented Interfaces:
LocalVolatility

public class DupireLocalVolatility extends Object implements LocalVolatility
Local volatility provider based on an interpolated option surface.

The class supports two formulas:

  • Dupire's formula from option prices,
  • Gatheral's formula from Black-Scholes implied lognormal volatilities.

The class is a concrete implementation of LocalVolatility. It is intended to be framework-neutral and may be used by finite-difference models and Monte Carlo models alike.

The supplied OptionSurfaceDataInterpolated remains responsible only for interpolation and quoting-convention conversion. This class is responsible only for computing the local volatility from that surface.

If the formula is set to DupireLocalVolatility.LocalVolatilityFormula.AUTOMATIC, then:

If a formula is selected explicitly, the constructor creates the appropriate converted surface at the original nodes by using OptionSurfaceDataInterpolated.getCloneForQuotingConvention(QuotingConv ention).

Author:
Alessandro Gnoatto
  • Constructor Details

    • DupireLocalVolatility

      public DupireLocalVolatility(OptionSurfaceDataInterpolated quoteSurface)
      Creates a Dupire local volatility provider using automatic formula selection.
      Parameters:
      quoteSurface - The interpolated option surface.
    • DupireLocalVolatility

      public DupireLocalVolatility(OptionSurfaceDataInterpolated quoteSurface, DupireLocalVolatility.LocalVolatilityFormula formula)
      Creates a Dupire local volatility provider using the selected formula.
      Parameters:
      quoteSurface - The interpolated option surface.
      formula - The formula to be used.
    • DupireLocalVolatility

      public DupireLocalVolatility(OptionSurfaceDataInterpolated quoteSurface, DupireLocalVolatility.LocalVolatilityFormula formula, double timeEpsilon, double strikeEpsilonFactor, double varianceFloor, DupireLocalVolatility.NegativeLocalVarianceHandling negativeLocalVarianceHandling)
      Creates a Dupire local volatility provider.
      Parameters:
      quoteSurface - The interpolated option surface.
      formula - The formula to be used.
      timeEpsilon - The finite-difference bump in time.
      strikeEpsilonFactor - The relative finite-difference bump in strike.
      varianceFloor - The local variance floor.
      negativeLocalVarianceHandling - The policy for negative local variances.
  • Method Details

    • getValue

      public double getValue(double time, double assetValue)
      Description copied from interface: LocalVolatility
      Returns the local volatility sigma(t, S).
      Specified by:
      getValue in interface LocalVolatility
      Parameters:
      time - The evaluation time.
      assetValue - The asset value.
      Returns:
      The local volatility.
    • getLocalVarianceFromOptionPrices

      public double getLocalVarianceFromOptionPrices(double time, double strike)
      Returns the local variance from Dupire's formula applied to option prices.
      Parameters:
      time - The option maturity.
      strike - The strike, interpreted as the asset value at which local volatility is evaluated.
      Returns:
      The local variance.
    • getLocalVolatilityFromOptionPrices

      public double getLocalVolatilityFromOptionPrices(double time, double strike)
      Returns the local volatility from Dupire's formula applied to option prices.
      Parameters:
      time - The option maturity.
      strike - The strike, interpreted as the asset value at which local volatility is evaluated.
      Returns:
      The local volatility.
    • getLocalVarianceFromImpliedVolatilities

      public double getLocalVarianceFromImpliedVolatilities(double time, double strike)
      Returns the local variance from Gatheral's implied-volatility formula.
      Parameters:
      time - The option maturity.
      strike - The strike, interpreted as the asset value at which local volatility is evaluated.
      Returns:
      The local variance.
    • getLocalVolatilityFromImpliedVolatilities

      public double getLocalVolatilityFromImpliedVolatilities(double time, double strike)
      Returns the local volatility from Gatheral's implied-volatility formula.
      Parameters:
      time - The option maturity.
      strike - The strike, interpreted as the asset value at which local volatility is evaluated.
      Returns:
      The local volatility.
    • getQuoteSurface

      public OptionSurfaceDataInterpolated getQuoteSurface()
      Returns the input quote surface.
      Returns:
      The input quote surface.
    • getFormulaSurface

      public OptionSurfaceDataInterpolated getFormulaSurface()
      Returns the surface actually used by the formula.

      For Dupire from prices, this is a price surface. For Gatheral, this is a lognormal implied-volatility surface.

      Returns:
      The formula surface.
    • getRequestedFormula

      public DupireLocalVolatility.LocalVolatilityFormula getRequestedFormula()
      Returns the requested formula.
      Returns:
      The requested formula.
    • getEffectiveFormula

      public DupireLocalVolatility.LocalVolatilityFormula getEffectiveFormula()
      Returns the effective formula.
      Returns:
      The effective formula.
    • getTimeEpsilon

      public double getTimeEpsilon()
      Returns the finite-difference bump in time.
      Returns:
      The time bump.
    • getStrikeEpsilonFactor

      public double getStrikeEpsilonFactor()
      Returns the relative finite-difference bump in strike.
      Returns:
      The strike bump factor.
    • getVarianceFloor

      public double getVarianceFloor()
      Returns the local variance floor.
      Returns:
      The variance floor.
    • getNegativeLocalVarianceHandling

      public DupireLocalVolatility.NegativeLocalVarianceHandling getNegativeLocalVarianceHandling()
      Returns the negative local variance handling policy.
      Returns:
      The policy.