Guide 03 Exact prices, no numerical method

Closed forms: the shifted lognormal mixture

AnalyticMethod prices a smile with the closed form of the model, when it has one: Black and Scholes, and the shifted lognormal mixture of Brigo and Mercurio. The second is a model worth calibrating on its own, and this page is about it.

Brigo–MercurioAnalyticMethodarbitrage freeGPUcomputed at build time

The model

The spot is a deterministic shift plus a process $A$ whose law at each time is a mixture of lognormals:

\[S_t = \alpha\, S_0\, e^{(r - d) t} + A_t, \qquad A_0 = (1 - \alpha) S_0, \qquad A_T \sim \sum_{j=1}^{n} w_j\, A_0\, e^{(r - d - \eta_j^2 / 2) T + \eta_j \sqrt{T} Z},\]

with $Z$ standard normal, volatilities $\eta_1, \dots, \eta_n > 0$ and weights $w_j = \lambda_j$ for $j < n$, $w_n = 1 - \sum_{j<n} \lambda_j$. In FinancialMonteCarlo it is ShiftedProcess(LogNormalMixture(η, λ), α): the $n$ volatilities and the $n - 1$ free weights as tuples, and the shift $\alpha < 1$ (LogNormalMixture alone is the mixture with no shift, and ShiftedProcess(BlackScholesProcess(σ), α) the displaced diffusion, a mixture of one component: both have the same closed form). Brigo and Mercurio show that a local volatility $\sigma(t, A_t)$ exists for which $A$ has exactly these marginals: the model is a diffusion, and not only a family of densities. FinancialMonteCarlo (≥ 0.8) simulates that diffusion, so its Monte Carlo prices of European options converge to the closed form (the tests check it to a few cents with 2¹⁴ Sobol paths and 50 steps), and a model calibrated here prices exotics by Monte Carlo consistently.

A European option on $S$ is an option on $A$ struck at $\kappa = K - \alpha S_0 e^{(r - d) T}$, and the mixture passes through the expectation: its price is the mixture of Black prices,

\[C(K, T) = \sum_{j=1}^{n} w_j\, C_{\text{black}}\!\left((1 - \alpha) F_T, \kappa, r, T, \eta_j\right), \qquad F_T = S_0 e^{(r - d) T},\]

and the same for a put. For $\kappa \le 0$ (a positive shift and a strike below it) the call is always exercised, $C = e^{-rT}(F_T - K)$, and the put is worthless. The implementation computes the shift, the forward and the weights once per smile, then one Black price per component and strike, by blkprice of FinancialToolbox.

Why calibrate it

Exact and fast

A price is n Black formulas: no quadrature, no truncation range, no simulation. A smile of a few hundred strikes with three components prices in about 0.15 ms on a laptop. The loss has no numerical noise, so the optimizer and the Levenberg–Marquardt polish reach a stationary point to machine precision, and the implicit derivatives of calibrated_parameters are those of the exact calibration.

Free of static arbitrage

A mixture of arbitrage-free prices is arbitrage free: the prices are decreasing and convex in the strike, and the forward is matched exactly, for every parameter, so no constraint is needed beyond the signs of η and λ.

Intuitive parameters

The mixture gives fat tails, the smile: the volatilities η are the regimes, the weights how likely they are. The shift gives the skew: α < 0 makes the spot more lognormal than A, with a downward sloping implied volatility; α > 0 the opposite.

Differentiable by every backend

The formula is straight-line code over blkprice, which has closed-form ChainRules rules, with no branch: ForwardDiff, Zygote, Mooncake and Enzyme differentiate it as well as the Fourier methods. Zygote's gradient of one price costs about 1.4 times the price itself, whatever the number of components.

On the GPU

The components are a tuple whose length is a type parameter, so a smile is one broadcast over its strikes, one thread per strike. With the strikes of MarketData on the device, or AnalyticMethod(; mode = CudaMode()), the prices never leave it.

Its limit is the term structure. The parameters are the same at every maturity, and the smile of a mixture of lognormals flattens with the maturity as $1/\sqrt{T}$ in log-moneyness: one set of parameters fits a few maturities, or one maturity at a time, better than a whole surface. Its local volatility dynamics also give forward smiles that are flatter than the market's, which matters for forward starting and cliquet options, not for the European quotes it is calibrated to.

On the DAX surface

The DAX surface of 22 August 2016, with three components, against Black and Scholes (a single component and no shift), both with the closed form:

using FinancialCalibrator, FinancialMonteCarlo

underlying, mkt = adapter(retriever(CalibrationID("Dax", "22Aug2016", "EUR"), IOFileInputStrategy()))
rms(res) = sqrt(2 * res.OptimalValue / count(!isnan, res.ModelVolatility))

bs = calibrate(BlackScholesProcess(0.2), underlying, AnalyticMethod(), mkt)
slnm = calibrate(ShiftedProcess(LogNormalMixture((0.1, 0.2, 0.35), (0.3, 0.4)), -0.1), underlying, AnalyticMethod(), mkt)
(black_scholes = rms(bs), shifted_lognormal_mixture = rms(slnm))
(black_scholes = 0.0315196877737609, shifted_lognormal_mixture = 0.021173844198257324)
315 bp
RMS error, Black–Scholes: one volatility for the whole surface
212 bp
RMS error, three-component shifted lognormal mixture
1.5×
smaller error, with six parameters and no numerical method

Four of the nine maturities, the model volatilities at the quotes:

Black–Scholes and the shifted lognormal mixture against the DAX quotesBlack–Scholes and the shifted lognormal mixture against the DAX quotes

The calibrated parameters, $(\eta_1, \eta_2, \eta_3, \lambda_1, \lambda_2, \alpha)$:

slnm.OptimalParam
6-element Vector{Float64}:
  2.6735880500101123e-8
  8.377580331160908e-15
  4.196842603168281e-8
  0.24416032456017786
  2.357643579622371e-165
 -5.3583817386600105e6

Other closed forms

A model gets a closed form by two methods, FinancialCalibrator.analytic_price_type(model) (the number type of its prices) and FinancialCalibrator.analytic_kernel(model, S0, r, d, T) (a callable (K, isCall) -> price, an isbits struct so that a GPU broadcast captures it); pricer(model, und, zero_rate, AnalyticMethod(), smile) does the rest, on the host or on the device.

The kernel is the code that every backend differentiates, one strike at a time, so it is written for all of them:

  • No branch, neither on the call flag nor on a value. Calls and puts differ by a weight (isCall * x is exact, false * Inf == 0), and a case such as $\kappa \le 0$ is a select, ifelse(positive, a, b), whose discarded side is still finite. Mooncake and Enzyme compile a branch away; Zygote records it on its tape, and its gradient becomes type unstable: about 7 times slower on a one-line kernel.
  • Every step inferred under Zygote. One construct whose pullback Zygote cannot infer makes the whole gradient dynamic. Two met here: sum(map(f, w, σ)) over the tuples of the components (the mixture sums them with a function unrolled at compile time instead) and oftype(x, y) (promote instead). Together they made the gradient of one price about 30 times slower.
  • Scalars and tuples, not arrays. The kernel runs in a GPU thread, which cannot allocate, and reverse mode differentiates the indexing of an array element by element.
  • Checks outside the formula. A domain check that throws goes in analytic_kernel, inside ChainRulesCore.@ignore_derivatives, so that no backend traces it.

A quick check of the last two points for Zygote is that Base.return_types(Zygote.pullback, Tuple{typeof(f), typeof(kernel)}) contains no Any.