TQBTHEQUANTBATEMAN
TQB/ learn/ volatility/ local volatilityEN · DARK
Volatility · advanced

Local volatility

An arbitrage-consistent diffusion fitted to today’s vanilla surface

BY THE END, YOU CAN

01Derive Dupire local variance from the forward equation.

02Explain why call-price derivatives demand smoothing.

03Contrast exact static fit with forward smile dynamics.

04Design stable interpolation and boundary checks.

01
INTUITION

Identify the state variables and the behavior they add.

Local volatility replaces one constant σ with a deterministic function σloc(S,t). Given a smooth arbitrage-consistent vanilla surface, Dupire identifies a diffusion that matches all European marginal distributions in ideal theory.

01

Exact vanilla fit is a static statement.

02

Differentiation amplifies quote noise.

03

Forward smile dynamics can be less realistic than the initial fit.

02
WHY MARKETS CARE

Ask which instruments can identify the dynamics.

Local volatility is a baseline for barrier and path-dependent pricing and a building block for local-stochastic volatility models.

INSTRUMENTS

barriers

digitals

autocallables

local-stochastic-volatility hybrids

QUOTE CONVENTION

Surface inputs must share forward, discount, dividend, expiry and strike conventions. Local variance is annualized decimal variance.

03
MATHEMATICS

Write the dynamics before interpreting parameters.

Formula · Full derivation

Local-vol diffusion

dSt=(r−q)Stdt+σloc(St,t)StdWtdS_t=(r-q)S_tdt+\sigma_{loc}(S_t,t)S_tdW_t

Volatility is deterministic conditional on current spot and time.

Open in Analytics
Formula · Full derivation

Dupire formula

σloc2(K,T)=∂TC+(r−q)K∂KC+qC12K2∂KKC\sigma_{loc}^2(K,T)=\frac{\partial_TC+(r-q)K\partial_KC+qC}{\tfrac12K^2\partial_{KK}C}

The call surface determines local variance where derivatives and density are well behaved.

Open in Analytics
Full derivation
Full derivation

Inverting the forward equation

Match the Fokker–Planck evolution of the local-vol diffusion to strike derivatives of call prices.

  1. 01

    Start with the diffusion

    Specify risk-neutral drift and a state-time diffusion coefficient.

    dS=(r−q)Sdt+σloc(S,t)SdWdS=(r-q)Sdt+\sigma_{loc}(S,t)SdW
  2. 02

    Write density evolution

    The forward Kolmogorov equation evolves terminal density under the diffusion.

  3. 03

    Connect density to calls

    Use Breeden–Litzenberger to replace terminal density by the second strike derivative of call prices.

    ∂KKC=Df(K,T)\partial_{KK}C=Df(K,T)
  4. 04

    Differentiate through maturity

    Differentiate the discounted payoff expectation in T and substitute the density evolution.

  5. 05

    Isolate local variance

    Rearrange the forward PDE to obtain Dupire’s numerator over the convexity denominator.

Dupire converts a full static surface into one diffusion, but the inversion is only as reliable as surface cleaning, smoothing and boundary treatment.

Inputs
  • σloc(S,t): local volatility
  • C(K,T): call surface
  • D(0,T): discount factor
  • ∂KKC: density term
Assumptions and limits
  • Noise amplification in derivatives.
  • Unrealistic forward smile dynamics can mis-hedge exotics.
  • Boundary extrapolation materially changes local vol.
Formula · Definition

Density requirement

∂KKC(K,T)>0\partial_{KK}C(K,T)>0

A small or negative denominator makes inversion unstable or invalid.

Open in Analytics
05
MODEL / PRICING

Calibrate, compute, and challenge the dynamics.

METHOD

Build an arbitrage-controlled call-price surface, compute stable derivatives, floor diagnostics rather than values, and solve PDEs with consistent boundaries.

CALIBRATION

The model is implied from the vanilla surface rather than optimized to it; smoothing hyperparameters are the effective calibration choices.

Implementation with current QuantLib

Current QuantLib separates market structures, processes, instruments, engines and calibration helpers. Use those abstractions only after the lesson’s conventions, domains and numerical checks are explicit.

API authority: upstream QuantLib reference pinned in the source registry.
06PYTHON IMPLEMENTATIONOpen the implementation and checks.
ARCHITECTURE
  • Validate domains and units at the boundary.
  • Keep the numerical kernel framework-free and deterministic.
  • Return diagnostics with values.
  • Test analytical limits and failure states.
PYTHON 3 · NUMPY / SCIPY

Dupire denominator diagnostic

Detect unstable density denominators before computing local variance.

REUSABLE EXAMPLE
01from __future__ import annotations
02
03import numpy as np
04
05def convexity(strikes: np.ndarray, calls: np.ndarray) -> np.ndarray:
06 if strikes.shape != calls.shape or strikes.size < 5:
07 raise ValueError("aligned grid with at least five nodes required")
08 h = np.diff(strikes)
09 if not np.allclose(h, h[0]):
10 raise ValueError("teaching implementation requires uniform strikes")
11 return (calls[:-2] - 2.0 * calls[1:-1] + calls[2:]) / h[0]**2
12
13k = np.arange(80.0, 125.0, 5.0)
14c = np.array([22.0, 18.0, 14.5, 11.5, 9.0, 7.0, 5.5, 4.5, 3.8])
15density_term = convexity(k, c)
16assert np.isfinite(density_term).all()
17assert np.all(density_term > 0.0)
18print(float(density_term.min()))
EXPECTED OUTPUTPositive minimum strike convexity for the teaching slice.
SANITY CHECKS

✓ Convexity is positive.

✓ Grid assumptions are validated.

✓ No denominator flooring hides an arbitrage failure.

07
INTERACTIVE LAB

Shock one parameter and trace the full response.

SURFACE DERIVATIVES AND DUPIRE STABILITY

Dupire stability lab

Change smoothing and grid spacing; inspect call convexity, local variance and failure regions.

SYNTHETIC · CONTROLLED SCENARIOS
ATM local vol21.96%
Max local vol27.40%
Noise stateSmooth
Local volatility / convexity by Strike

Smooth: Stable convex price slice.

  • local volatility
  • scaled density
Strike: 70. local volatility: 0.2740. scaled density: 0.0040.

Use Left/Right or Up/Down arrows to inspect values; Home and End jump to the bounds.

ACTIVE STATE

Smooth — Stable convex price slice. Move the intensity control and inspect every series with pointer or touch.

08
FRONT OFFICE

Where the model meets the book.

ON THE DESK
“The calibration is exact because the interpolation made the difficult decisions first.”
VISIBLE INPUTS

clean call surface

curves and forwards

smoothing rule

grid

boundaries

CALIBRATION

The model is implied from the vanilla surface rather than optimized to it; smoothing hyperparameters are the effective calibration choices.

RISK

local-vol vega

barrier sensitivity

surface derivative risk

grid risk

DAILY WORKFLOW
  1. clean prices
  2. enforce shape
  3. differentiate
  4. diagnose denominator
  5. solve PDE
Production failure modes
  • negative density
  • noisy time derivative
  • wing explosion
  • boundary artifacts
09MACRO CONNECTIONOpen the transmission channel.
MACRO CONNECTION

Spot moves through a state-dependent surface

A local-vol model maps today’s skew into spot-dependent future diffusion, linking selloffs to higher instantaneous volatility without an independent variance shock.

01Current skewtransmits

defines state dependence

02Spot sellofftransmits

moves into higher local vol

03Path distributiontransmits

changes barrier probabilities

04Exotic hedgeoutput

inherits local dynamics

10COMMON PITFALLSOpen the failure checklist.
01

Differentiating raw implied vols.

02

Calling exact vanilla fit a validation of dynamics.

03

Flooring negative local variance silently.

04

Ignoring extrapolation in path-dependent pricing.

11SOURCES / FURTHER READINGOpen sources and continue the track.
research

Volatility, Monte Carlo and stochastic-volatility lectures

Research map for the mathematical progression and numerical experiments; prose, examples and code are original.

Source
Computational Finance Course
Author
L. A. Grzelak
Ref
main
OPEN ORIGINAL SOURCE ↗
implementation reference

Current volatility structures, processes, calibration helpers and tests

Implementation reference for production abstractions and validation patterns.

Source
QuantLib upstream
Author
QuantLib contributors
Ref
v1.42.1
OPEN ORIGINAL SOURCE ↗