Module contents
Lesson 15 of 30Core 110 min

Implied volatility, arbitrage-free surfaces and local volatility

Invert option prices to implied volatility and study smile, risk-neutral density, SVI, surface arbitrage and Dupire local volatility.

After this lesson you can

  • Invert prices to implied volatility robustly using safeguarded Newton steps and rational bounds.
  • Describe smile, skew and term structure and relate them to risk-neutral tails and asymmetry.
  • Extract risk-neutral density with Breeden-Litzenberger and diagnose negative densities.
  • State and check calendar and butterfly no-arbitrage conditions in total variance.
  • Fit constrained SVI slices and derive Dupire local volatility.

Before you start

A quote expressed as volatility

Implied volatility is the value of σ\sigma reproducing a European Black-Scholes price for fixed inputs S,K,r,q,TS,K,r,q,T. It is a price coordinate, not a claim that actual volatility is constant. For a call, positive vega makes price strictly increasing in σ>0\sigma>0, so a finite interior solution is unique.

Before inversion, check the bounds

max⁡(Se−qT−Ke−rT,0)≤C<Se−qT.\max(Se^{-qT}-Ke^{-rT},0)\le C<Se^{-qT}.

Equality at the lower bound corresponds to σ=0\sigma=0; the upper bound is a limit as σ→∞\sigma\to\infty, not a finite solution. Put bounds are max⁡(Ke−rT−Se−qT,0)\max(Ke^{-rT}-Se^{-qT},0) and Ke−rTKe^{-rT}. Outside the bounds no compatible volatility exists; within a bid-ask very near intrinsic value, small vega makes inversion ill-conditioned. A rounded price can make several volatilities indistinguishable.

Newton updates σ←σ−(CBS−Cmercado)/V\sigma\leftarrow\sigma-(C_{\rm BS}-C_{\rm mercado})/\mathcal V, but tiny vega or a step outside the interval can make it fail. Keep a bracket around the root and use bisection if the Newton step is unsafe. The Brenner-Subrahmanyam approximation σ≈C2π/(ST)\sigma\approx C\sqrt{2\pi}/(S\sqrt T) is a starting point near the money with zero rates and dividends, not an accurate formula at every strike. Jäckel develops specialized inversion methods; the lab implements a safeguarded method, not that algorithm.

From smile to density

The smile or skew describes how implied volatility changes with strike and maturity. Equity indices often show higher implied volatility at low strikes; jump asymmetry, demand for protection and leverage effects are possible mechanisms, not a single causal explanation. Compare quotes with the same maturity and forward, respecting bid-ask and times.

With deterministic discounting and sufficiently regular density under QQ,

C(K,T)=e−rT∫K∞(s−K)fQ(s,T) ds,fQ(K,T)=erT∂2C∂K2.C(K,T)=e^{-rT}\int_K^\infty(s-K)f_Q(s,T)\,ds,\qquad f_Q(K,T)=e^{rT}\frac{\partial^2 C}{\partial K^2}.

The Breeden-Litzenberger formula expresses strike convexity: a negative density implies a negative-cost, nonnegative-payoff butterfly under the model’s assumptions and simultaneous prices. With discrete data, consider bid-ask intervals, nonuniform steps and measurement error; differentiating twice amplifies noise. Breeden and Litzenberger (1978) relate option prices to contingent state claims.

InteractiveFrom smile to density
  • Implied volatility
  • Implied density
0.12
-0.4
0.20
Minimum g on the grid0.375
Strike at the minimum60.0
Unit-width butterfly cost0.00302
Hypothetical SVI slice with S₀ = F = 100, r = q = 0 and T = 1; the normal CDF used in prices is approximate. Controls change slope, asymmetry and curvature; smile and implied density are shown. Cost is C(K−1)−2C(K)+C(K+1) at the strike where g is minimal on the grid; when negative, the butterfly has nonnegative payoff and negative cost. Checks do not cover strikes outside [60,140].

Total variance and surface constraints

With forward FT=Se(r−q)TF_T=Se^{(r-q)T}, use k=log⁡(K/FT)k=\log(K/F_T) and w(k,T)=σimp2(k,T)Tw(k,T)=\sigma_{\rm imp}^2(k,T)T. For deterministic carry curves, comparing normalized calls at the same kk shows that absence of calendar arbitrage requires ww nondecreasing in TT at fixed kk. Comparing unnormalized prices at fixed strike can confuse that result with the carry effect.

The reason is convexity: if Mt=St/FtM_t=S_t/F_t is a martingale under the model assumptions, expected (MT−ek)+(M_T-e^k)^+ does not decrease with horizon by conditional Jensen. Normalized Black price at fixed kk strictly increases with w>0w>0; hence price ordering implies total-variance ordering. If carry or numeraire is treated differently, normalization must be justified again.

For a smooth positive slice w(k)w(k) define

g(k)=(1−kw′2w)2−(w′)24(1w+14)+w′′2.g(k)=\left(1-\frac{k w'}{2w}\right)^2 -\frac{(w')^2}{4}\left(\frac1w+\frac14\right)+\frac{w''}{2}.

Surface no-arbitrage requires g(k)≥0g(k)\ge0 for nonnegative density and compatible temporal growth over the full domain. Global sufficiency also needs appropriate tail and boundary conditions; testing a finite grid does not certify wings or intermediate maturities. Red in the chart means failure at a sampled point, not a complete proof of arbitrage or its absence in the continuum.

InteractiveThe surface and its arbitrages
0.12
0.000
Maximum w on the grid0.284
Points with negative g0
Points with negative calendar slope0
Nonpositive variances0
Synthetic surface w(k,T) = T·SVI(k) + cT(T−0.6), with k from −0.8 to 0.8 and T from 0.25 to 1.75. Height is normalized by the grid maximum shown in the panel. Red points indicate nonpositive variance, negative g or negative time derivative; negative values are clipped only for display. Drag to rotate.

SVI and local volatility

The SVI parameterization of a slice is

w(k)=a+b{ρ(k−m)+(k−m)2+s2},b≥0, ∣ρ∣<1, s>0.w(k)=a+b\{\rho(k-m)+\sqrt{(k-m)^2+s^2}\},\qquad b\ge0,\ |\rho|<1,\ s>0.

aa shifts the level, bb scales the wings, ρ\rho modulates asymmetry, mm shifts the center and ss smooths curvature. The condition a+bs1−ρ2≥0a+bs\sqrt{1-\rho^2}\ge0 guarantees nonnegativity of the slice minimum but not g≥0g\ge0 or compatibility across maturities. Fitting slices separately can cause crossings. SSVI couples slices through an ATM-variance parameterization and additional calendar and wing conditions; Gatheral and Jacquier give explicit conditions for constructing surfaces without static arbitrage.

For example, with θ(T)=w(0,T)\theta(T)=w(0,T) and positive function φ(θ)\varphi(\theta), SSVI writes

w(k,T)=θ2[1+ρφ(θ)k+(φ(θ)k+ρ)2+1−ρ2].w(k,T)=\frac{\theta}{2}\left[1+\rho\varphi(\theta)k+ \sqrt{(\varphi(\theta)k+\rho)^2+1-\rho^2}\right].

For 0<∣ρ∣<10<|\rho|<1, one family of sufficient conditions in the paper requires θ′(T)≥0\theta'(T)\ge0, 0≤∂θ(θφ)≤[(1+1−ρ2)/ρ2]φ0\le\partial_\theta(\theta\varphi)\le[(1+\sqrt{1-\rho^2})/\rho^2]\varphi, θφ(1+∣ρ∣)<4\theta\varphi(1+|\rho|)<4 and θφ2(1+∣ρ∣)≤4\theta\varphi^2(1+|\rho|)\le4 for all θ>0\theta>0. These concern the full SSVI surface, not constraints automatically imposed by the lab’s slice fit. For ρ=0\rho=0 use the appropriate limit of the calendar condition.

InteractiveThe five SVI parameters
  • SVI slice
  • Synthetic observations
0.030
0.08
-0.35
0.02
0.25
Total variance RMSE0.00103
Minimum g on the grid0.411
Points come from a known synthetic SVI with a small deterministic perturbation, not observed quotes. Controls change its five parameters; RMSE is on total variance and minimum g is evaluated only on k ∈ [−0.8,0.8].

Dupire local volatility follows from the forward pricing equation. For constant rates and dividends and a sufficiently smooth surface,

σloc2(K,T)=CT+(r−q)KCK+qC12K2CKK=∂Tw(k,T)∣kg(k,T).\sigma_{\rm loc}^2(K,T)= \frac{C_T+(r-q)KC_K+qC}{\tfrac12 K^2 C_{KK}} =\frac{\partial_T w(k,T)|_k}{g(k,T)}.

The second equality uses forward kk and a time derivative at fixed kk. The denominator must be positive and numerator nonnegative; near zero, division and second derivatives amplify errors. Under suitable regularity and conditions, local diffusion reproduces marginals compatible with the call surface and is determined where density is positive. Other dynamic models can reproduce those marginals with different temporal dependence: the surface does not identify a unique dynamic across all model classes.

InteractiveLocal volatility from implied volatility
  • Blue: local σ (0 to 0.6)
  • Red: invalid
0.0000
Invalid grid cells0 / 858
Valid range of local σ0.200 to 0.200
Synthetic Dupire map for w(k,T) = 0.04T + ε sin(20k) sin(4T). Horizontal: k from −0.8 to 0.8; vertical: T from 0.25 to 1.5. The blue local-σ scale saturates at 0.6; red marks points without a positive quotient. Perturbation applies to total variance and derivatives are finite differences, not market data.

Lab: safeguarded inversion

The inversion routine reports quote status, handles limits and uses Newton only inside a bracketed root; other iterations use bisection. Tolerance is in price, so small vega limits recoverable accuracy of σ\sigma.

[ ]Newton and bisectionBrowser
import numpy as np
from scipy.special import ndtr
from scipy.optimize import brentq
def bs(S,K,r,q,T,sigma,kind='call'):
    S,K,r,q,T,sigma=np.broadcast_arrays(*[np.asarray(x,float) for x in (S,K,r,q,T,sigma)])
    A=S*np.exp(-q*T); B=K*np.exp(-r*T); v=sigma*np.sqrt(T); safe=np.where(v>0,v,1.)
    d1=(np.log(A/B)+.5*v*v)/safe; d2=d1-v
    c=np.where(v>0,A*ndtr(d1)-B*ndtr(d2),np.maximum(A-B,0))
    return c if kind=='call' else c-A+B
def implied(price,S,K,r,q,T,kind='call',tol=1e-11,maxiter=100):
    P,S,K,r,q,T=np.broadcast_arrays(*[np.asarray(x,float) for x in (price,S,K,r,q,T)])
    if kind not in ('call','put') or np.any(S<=0) or np.any(K<=0) or np.any(T<=0): raise ValueError('Entradas inválidas')
    A=S*np.exp(-q*T); B=K*np.exp(-r*T); lower=np.maximum(A-B,0) if kind=='call' else np.maximum(B-A,0); upper=A if kind=='call' else B
    scale=np.maximum(1.,np.maximum(A,B)); eps=tol*scale
    outside=~np.isfinite(P)|(P<lower-eps)|(P>upper+eps); near_upper=~outside&(P>=upper-eps)
    valid=~outside&~near_upper; at_lower=valid&(P<=lower+eps)
    lo=np.zeros(P.shape); hi=np.full(P.shape,8.); sigma=np.clip((P-lower)*np.sqrt(2*np.pi)/(A*np.sqrt(T)),.2,2.)
    result=np.full(P.shape,np.nan); result=np.where(at_lower,0.,result); iterations=np.zeros(P.shape,int); active=valid&~at_lower
    bracket=bs(S,K,r,q,T,hi,kind)>=P; active &= bracket
    for i in range(maxiter):
        if not np.any(active): break
        value=bs(S,K,r,q,T,sigma,kind); residual=value-P; done=active&(np.abs(residual)<=eps)
        result=np.where(done,sigma,result); iterations=np.where(done,i+1,iterations); active &= ~done
        lo=np.where(active&(residual<0),sigma,lo); hi=np.where(active&(residual>=0),sigma,hi)
        v=sigma*np.sqrt(T); d1=(np.log(A/B)+.5*v*v)/np.where(v>0,v,1.); vega=A*np.exp(-.5*d1*d1)/np.sqrt(2*np.pi)*np.sqrt(T)
        newton=sigma-residual/np.maximum(vega,1e-300); candidate=np.where((newton>lo)&(newton<hi)&(vega>1e-12),newton,(lo+hi)/2)
        sigma=np.where(active,candidate,sigma)
    status=np.where(at_lower,'límite cero',np.where(np.isfinite(result),'ok',np.where(outside,'fuera de cotas',np.where(near_upper,'cota superior o indistinguible','sin convergencia o intervalo'))))
    return result,iterations,status
[ ]Comparison with BrentBrowser
Ks=np.array([60.,80.,90.,100.,110.,120.,140.]); vols=np.array([.15,.25,.5,1.]); K,V=np.meshgrid(Ks,vols); prices=bs(100,K,.03,.01,1,V)
iv,it,status=implied(prices,100,K,.03,.01,1); lower=np.maximum(100*np.exp(-.01)-K*np.exp(-.03),0)
identifiable=(prices-lower>1e-7)&(status=='ok'); ref=np.full(K.shape,np.nan)
for index in zip(*np.where(identifiable)):
    ref[index]=brentq(lambda x: float(bs(100,K[index],.03,.01,1,x)-prices[index]),1e-9,8.)
print('estados',dict(zip(*np.unique(status,return_counts=True))),'casos identificables',int(identifiable.sum()))
print('máximo error frente a Brent',float(np.nanmax(np.abs(iv-ref))),'mediana iteraciones',float(np.median(it[identifiable])),'fracción con menos de 10',float(np.mean(it[identifiable]<10)))
bad,_,diagnostic=implied(np.array([-1.,101.,0.]),100,100,0,0,1); print('precios inválidos y límite',bad,diagnostic)
g=np.random.default_rng(281515); K=100*np.exp(g.uniform(-.4,.4,1000)); V=g.uniform(.12,.8,1000); T=g.uniform(.25,2.,1000)
prices=bs(100,K,.03,.01,T,V); iv,it,status=implied(prices,100,K,.03,.01,T); lower=np.maximum(100*np.exp(-.01*T)-K*np.exp(-.03*T),0); ok=(status=='ok')&(prices-lower>1e-7)
print('muestra adicional identificable',int(ok.sum()),'fracción con menos de 10',float(np.mean(it[ok]<10)),'máximo error frente a volatilidad generadora',float(np.max(np.abs(iv[ok]-V[ok]))))

The iteration fraction is a result of the tested set, not a 99% promise for all quotes. Numerical equalities near intrinsic value are classified as a limit within tolerance and need not recover the original volatility.

The 0.2 floor on the initial guess is a heuristic to avoid starting with near-zero vega; it does not constrain the solution. In the 28-case grid all finished in fewer than ten iterations and maximum error versus Brent was 1.44×10−111.44\times10^{-11}. In the additional synthetic sample, 999 of 1000 finished in fewer than ten and maximum error versus generating volatility was 2.37×10−92.37\times10^{-9}; their ranges are defined in the cell. Prices −1 and 101 are rejected for the ATM call and price zero is classified as the zero-volatility limit.

Lab: fitting and local-volatility repricing

We generate prices from a known mixture of two GBMs with the same forwards and volatilities 16% and 35%, weights 0.7 and 0.3. This is a synthetic mixture distribution, not real data or a simulation of one constant volatility. Add uniform price perturbation, fit SVI slices with constrained least squares and check gg and calendar on a finite grid. Total variance is linearly interpolated in time and spatial endpoints extended constantly for repricing: that extension is an additional numerical assumption.

[ ]Synthetic surface and SVIBrowser
from scipy.optimize import minimize
def svi(k,p):
    a,b,rho,m,s=p; z=k-m; root=np.sqrt(z*z+s*s)
    return a+b*(rho*z+root), b*(rho+z/root), b*s*s/root**3
def g_svi(k,p):
    w,wk,wkk=svi(k,p); return (1-k*wk/(2*w))**2-.25*wk**2*(1/w+.25)+.5*wkk
g=np.random.default_rng(281501); maturities=np.array([.5,1.,2.]); strikes=np.linspace(75,130,23); ks=np.log(strikes/100); grid=np.linspace(-.6,.6,121); fitted=[]
for T in maturities:
    true=.7*bs(100,strikes,0,0,T,.16)+.3*bs(100,strikes,0,0,T,.35)
    noisy=np.clip(true+g.uniform(-.02,.02,len(strikes)),np.maximum(100-strikes,0)+1e-8,100-1e-8)
    iv,_,status=implied(noisy,100,strikes,0,0,T); observed=iv*iv*T
    if not np.all(status=='ok'): raise RuntimeError('Cotización sintética no identificable')
    prev=fitted[-1] if fitted else None
    def objective(p): return float(np.mean((svi(ks,p)[0]-observed)**2))
    cons=[{'type':'ineq','fun':lambda p:svi(grid,p)[0]-1e-5},{'type':'ineq','fun':lambda p:g_svi(grid,p)-1e-5}]
    if prev is not None: cons.append({'type':'ineq','fun':lambda p,prev=prev:svi(grid,p)[0]-svi(grid,prev)[0]-1e-6})
    fit=minimize(objective,[.02*T,.04*T,-.2,0,.25],method='SLSQP',bounds=[(1e-5,.5),(1e-5,1),(-.95,.95),(-.6,.6),(.02,1)],constraints=cons,options={'maxiter':500,'ftol':1e-12})
    if not fit.success: raise RuntimeError(fit.message)
    fitted.append(fit.x); print('T',T,'RMSE w',round(np.sqrt(fit.fun),7),'mínimo g',round(float(g_svi(grid,fit.x).min()),6),'parámetros',np.round(fit.x,5))
print('mínimos de calendario en rejilla',[round(float(np.min(svi(grid,fitted[i+1])[0]-svi(grid,fitted[i])[0])),7) for i in range(2)])
[ ]Dupire and Monte CarloBrowser
def local_vol(t,k):
    k=np.asarray(k); t=max(t,1e-5)
    if t<=maturities[0]:
        w,wk,wkk=svi(k,fitted[0]); wt=w/maturities[0]; w*=t/maturities[0]; wk*=t/maturities[0]; wkk*=t/maturities[0]
    else:
        j=min(np.searchsorted(maturities,t)-1,len(maturities)-2); t0,t1=maturities[j:j+2]; u=(t-t0)/(t1-t0)
        a=svi(k,fitted[j]); b=svi(k,fitted[j+1]); w=(1-u)*a[0]+u*b[0]; wk=(1-u)*a[1]+u*b[1]; wkk=(1-u)*a[2]+u*b[2]; wt=(b[0]-a[0])/(t1-t0)
    den=(1-k*wk/(2*w))**2-.25*wk*wk*(1/w+.25)+.5*wkk
    if np.any(wt<=0) or np.any(den<=0): raise ValueError('Dupire inválida en la rejilla')
    return np.sqrt(wt/den)
g=np.random.default_rng(281502); N,steps=12000,160; dt=2/steps; logS=np.full(N,np.log(100.)); kgrid=np.linspace(-.6,.6,241); snapshots={}; clipped=0
for i in range(steps):
    t=(i+.5)*dt; siggrid=local_vol(t,kgrid); raw=logS-np.log(100.); clipped+=int(np.sum((raw<kgrid[0])|(raw>kgrid[-1])))
    vol=np.interp(raw,kgrid,siggrid); logS+=-.5*vol**2*dt+vol*np.sqrt(dt)*g.standard_normal(N)
    if i+1 in (80,160): snapshots[(i+1)*dt]=np.exp(logS.copy())
for T in (1.,2.):
    K=100.; sample=np.maximum(snapshots[T]-K,0); j=list(maturities).index(T); w=svi(np.array([0.]),fitted[j])[0][0]; fitted_call=float(bs(100,K,0,0,T,np.sqrt(w/T)))
    print('T',T,'MC',round(sample.mean(),5),'EE',round(sample.std(ddof=1)/np.sqrt(N),5),'call ajustada',round(fitted_call,5))
print('fracción de estados fuera de rejilla',clipped/(N*steps))

The test checks the cycle over a finite domain and discretization. Piecewise temporal interpolation, extension in k and Monte Carlo sampling add errors; a good fit at observed strikes does not validate the wings. If gg or the time derivative fails on the grid, the cell stops instead of taking a square root of a negative number.

In the run, total-variance RMSE for 0.5, 1 and 2 years was 0.0003435, 0.0002990 and 0.0003186; grid calendar minima were 0.0232616 and 0.0467100. For strike 100, local Monte Carlo gave 8.72273 with SE 0.14698 at one year and 12.38714 with SE 0.22233 at two, versus fitted prices 8.61007 and 12.15585. 2.92% of states per step fell outside the grid and used boundary extension; this limits validation and does not prove exact equality in the wings.

Public data: VIX is not strike volatility

VIX summarizes a portfolio of SPX options with maturity near 30 days according to the Cboe methodology. It is not the implied volatility of a particular call or data for directly fitting the synthetic slices above. The local cell queries the primary source and fixes the analysis date; public files may be revised.

[ ]Cboe historical VIX closeLocal GPU
import pandas as pd
url='https://cdn.cboe.com/api/global/us_indices/daily_prices/VIX_History.csv'
vix=pd.read_csv(url); vix['DATE']=pd.to_datetime(vix['DATE']); sample=vix[vix['DATE'].between('2026-11-11','2026-11-16')].sort_values('DATE')
print(sample[['DATE','CLOSE']].to_string(index=False))
This cell needs the local lab (PyTorch with your GPU). Start it with npm run lab and open the connection link.

In the November 17, 2026 download, closes for the 11th, 12th, 13th and 16th were 17.49, 18.70, 19.30 and 22.91 index points. Source: Cboe, VIX history. These historical observations can change if the provider corrects its file.

Exercises

ProofDifferentiate a call price
Prove: Derive fQ(K)=erTCKK(K,T)f_Q(K)=e^{rT}C_{KK}(K,T) under sufficient regularity.
0
C=e−rT∫K∞(s−K)fQ(s) dsC=e^{-rT}\int_K^\infty(s-K)f_Q(s)\,ds.

Step 1 of 3. What remains after one derivative in K?

ProofCalendar at forward moneyness
Prove: Explain why w(k,T)w(k,T) cannot decrease with T in an arbitrage-free market with deterministic carry.
0
Compare forward-normalized calls at the same k=log⁡(K/FT)k=\log(K/F_T).

Step 1 of 3. What does normalized Black price depend on at fixed k?

NumericVolatility near the money
With S = K = 100, r = q = 0, T = 1 and call 7.97, estimate σ using the Brenner-Subrahmanyam approximation.
QuizInterpret the skew
What can be concluded directly from negative skew in index options?
CodeSafeguarded Newton for calls and puts
Implement implied_vol(price,S,K,r,q,T,kind), with kind call or put. Return (volatility, diagnostic, iterations); reject out-of-bounds prices with NaN, distinguish lower and upper limits, and use Newton within [0,8] with bisection fallback. The test measures at least 99% of sample cases in fewer than ten iterations for each type, without extrapolating that rate.
def implied_vol(price,S,K,r,q,T,kind):
  raise NotImplementedError()
Shift+Enter to run

Ideas to remember

Implied volatility represents a price and can be ill-conditioned when vega is small. Density, calendar and butterfly impose constraints across the full surface; a grid provides a partial diagnostic. Dupire differentiates twice and requires regularity: fitting and validating the domain is part of the calculation.