Implied surface in, local volatility out — recomputed as you drag
Slice at the selected maturity
Durrleman's g(k) — the denominator of Dupire's formula
What am I looking at?
The left surface is what the option market quotes: for every strike and expiry, the single Black–Scholes volatility that reproduces that option's price. It is not a volatility the stock ever has — it is a quoting convention, and the fact that it varies with strike is the market telling you Black–Scholes is wrong.
The right surface is the answer to a different question: what volatility function σ(S, t), depending on where the stock is and when, would reproduce every one of those quoted prices exactly? Dupire showed there is exactly one, and gave the formula. Roughly, implied vol is an average over paths and local vol is the instantaneous value being averaged, which is why the local surface is steeper: to average out to a skew, the instantaneous vol has to slope about twice as hard.
The bottom-right chart is the denominator of that formula. It is identically the no-butterfly-arbitrage condition on the implied slice. Where it dips below zero, the implied surface implies a negative probability, and the local volatility there is not large — it is undefined. Drag ρ to −0.95 with a wide η and watch it happen.
The smoothing dial
What λ buys and what it costs
Local vol skew at 1Y — the thing oversmoothing quietly removes
What am I looking at?
Dupire's formula needs the second derivative of the surface in strike. Market quotes are only accurate to about half a tick, and differentiating noise twice amplifies it enormously — the classic ill-posed inverse problem. So the surface has to be smoothed first, and λ controls how much.
Turn λ down and the fit is beautiful and the local vol surface is garbage: the denominator crosses zero and the local variance goes to a pole. Turn λ up and the local vol surface is smooth, well behaved, and no longer contains the smile you were trying to price with. The bottom-right chart is the one to watch — it is the quantity a barrier price actually depends on, and it dies silently.
The other form of Dupire's equation — and why nobody uses it
Error against the analytic answer, by moneyness
∂²C/∂K² — the denominator, on a log scale
What am I looking at?
Both forms of Dupire's equation describe the same surface. This panel applies the call-price form to the same analytic SSVI surface the previous tab uses, so there is no market noise involved at all and the exact answer is known. Every deviation is the cost of differentiating prices twice in strike by finite differences.
The right-hand chart is why. ∂²C/∂K² is the risk-neutral density times a discount factor; in the wings it decays like a Gaussian tail. Divide a small noisy number by a smaller one and the answer is noise. In the implied-vol form, that same quantity appears as a smooth O(1) expression in w and its derivatives, and never as a subtraction of nearly equal prices.
What the smile is worth on a barrier option
Smile effect across the barrier grid (precomputed, Python PDE)
Local vol along the path the option cares about
What am I looking at?
A down-and-out call pays like a normal call unless the stock ever touches the barrier, in which case it pays nothing. It is cheaper than the call, and how much cheaper depends entirely on how likely the barrier is to be hit — which depends on the volatility down there, not on the volatility at the strike.
Flat Black–Scholes only has one volatility to offer. Whichever one you pick — the at-the-money vol, the strike vol, the vol at the barrier level — it is the same number everywhere along the path, and equity index surfaces are skewed: the market prices downside moves at a much higher volatility than upside ones. Local volatility puts that skew where it belongs, and the price changes by the tens of basis points of spot shown above. On a real ticket that is many times the bid–offer.
The "already knocked" and zero-vol cases are handled rather than hidden: drag the barrier through spot and the panel tells you the contract is dead rather than drawing an empty chart.
Why any of this should be believed
1 — Round trip: local vol → forward Dupire PDE → implied vol
2 — Barrier engines against Reiner–Rubinstein at flat vol
| Contract | H | Closed form | PDE | PDE error | MC | MC ± s.e. | MC error (s.e.) | KO discount |
|---|
3 — PDE convergence
| Nodes | Steps | Price | |error| | Observed order |
|---|
4 — Monte Carlo: the Brownian-bridge correction
Fit quality of the implied surface this is all built on
| Quantity | Value | Comment |
|---|