Class DupireLocalVol

java.lang.Object
com.quantfinlib.pricing.DupireLocalVol

public final class DupireLocalVol extends Object
Dupire (1994) local volatility from an implied total-variance surface, in Gatheral's form (Gatheral 2006, The Volatility Surface, equation 1.10):
  σ_loc²(T, y) = ∂_T w / [ 1 − (y/w) ∂_y w + ¼(−¼ − 1/w + y²/w²)(∂_y w)² + ½ ∂_yy w ]

with w = w(T, y) total implied variance and y = ln(K/F(T)). The denominator is the Gatheral-Jacquier density factor g(y), so it is positive exactly where the surface has no butterfly arbitrage and the numerator is non-negative exactly where it has no calendar arbitrage. Derivatives are central differences (step 1e-4 in y and min(1e-4, t/4) in T) on the surface, so any TotalVarianceSurface works; at a pillar of a piecewise-linear θ_t the T-difference averages the two one-sided slopes.

Local vol is a function of calendar time t and spot S, with y = ln(S/F(t)). Times below MIN_TIME are evaluated at MIN_TIME, since the short-expiry limit of a parametric surface is not identified by the quotes. A non-positive numerator or denominator is an arbitrage in the input surface and raises an exception rather than returning NaN.

  • Field Details

    • MIN_TIME

      public static final double MIN_TIME
      Floor on t (years) when evaluating the surface derivatives.
      See Also:
  • Constructor Details

  • Method Details

    • surface

      public TotalVarianceSurface surface()
    • localVol

      public double localVol(double t, double s)
      Local volatility at calendar time t (years) and spot s.
    • localVolAtMoneyness

      public double localVolAtMoneyness(double t, double y)
      Local volatility at time t > 0 and log-moneyness y = ln(S/F(t)).