Theory 01 Greeks of every order from one Taylor series

The Dual Spectral Theorem

Price with LewisMethod and a TaylorSeries.Taylor1 parameter, and you get every derivative of the price up to order $n$ in one pass. This works for every model with a characteristic exponent and every parameter, the jump parameters included. Behind it is the Dual Spectral Theorem, the frequency space form of the Spectral Theorem of VibratoMonteCarlo.jl: the two packages differentiate the same price on the two sides of the Fourier transform.

LewisMethodTaylorSeriesFaà di BrunoLévy modelscomputed at build time

Every order in one pass

The derivatives of a Merton call in the jump intensity $\lambda$, up to the fourth order. The $k$-th coefficient of a Taylor1 is the $k$-th derivative divided by $k!$:

using FinancialFFT, FinancialMonteCarlo, TaylorSeries, ForwardDiff

und, rate, method = Underlying(100.0, 0.01), ZeroRate(0.02), LewisMethod(600.0, 20001)
call = EuropeanOption(1.1, 105.0)
price(λ) = pricer(MertonProcess(0.2, λ, 0.03, 0.02), und, rate, method, call)
derivatives(f, x, n) = (p = f(x + Taylor1(n)); [factorial(k) * getcoeff(p, k) for k = 0:n])

∂λ = derivatives(price, 5.0, 4)   # V₀, ∂λ V₀, …, ∂⁴λ V₀
5-element Vector{Float64}:
  7.31820982697262
  0.12829233511245472
 -0.0018492597296688683
  7.82949860161476e-5
 -5.397222922194491e-6

The first two agree with nested ForwardDiff:

d1 = ForwardDiff.derivative(price, 5.0)
d2 = ForwardDiff.derivative(λ -> ForwardDiff.derivative(price, λ), 5.0)
(∂λ[2] - d1, ∂λ[3] - d2)
(1.1102230246251565e-16, -4.336808689942018e-19)

A Taylor1 of order $n$ carries $n + 1$ coefficients, where $n$ nested ForwardDiff duals carry $2^n$ components, most of them repeated. For several parameters at once, TaylorN gives the mixed derivatives (Automatic differentiation).

Why it works

Let $X_T = \log S_T$, $\Phi(x)$ the payoff as a function of $X_T$, and

\[L(w; \theta) = -r T + w \left(\log S_0 + (r - d) T - T \psi(1)\right) + T \psi(w)\]

the logarithm of the discounted moment generating function of $X_T$, with $\psi$ the characteristic exponent of the model (characteristic_exponent_i, in the variable $w = i u$; $\psi(1)$ is the martingale correction) and $\theta$ any input. With $\hat\Phi(z) = \int e^{i z x} \Phi(x)\, dx$ the transform of the payoff, on a line $z = \xi + i \beta$ of its strip, the price is the Lewis integral Lewis (2001):

\[V_0 = \frac{1}{2 \pi} \int_{\mathbb{R}} \hat\Phi(z)\, e^{L(w; \theta)}\, d\xi, \qquad w = -i z\]

$\theta$ enters only through $L$. Faà di Bruno's formula for the exponential, $\partial^n_\theta e^{L} = e^{L} B_n(\partial_\theta L, \dots, \partial^n_\theta L)$, with $B_n$ the complete exponential Bell polynomials, gives:

Dual Spectral Theorem

Where the derivatives can be taken under the integral,

\[\partial^n_\theta V_0 = \frac{1}{2 \pi} \int_{\mathbb{R}} \hat\Phi(z)\, e^{L(w; \theta)}\, B_n(\{\partial^i_\theta L(w; \theta)\}_{i = 1 : n})\, d\xi\]

The multiplier $B_n(\{\partial^i_\theta L\})(w)$ depends on the model, the input and the maturity, never on the payoff: it is the frequency space counterpart of the likelihood ratio weight $B_n(\{\partial^i_\theta \log f\})$ of VibratoMonteCarlo.jl.

The hypotheses (an integrable bound of $\hat\Phi\, \partial^k_\theta e^{L}$ uniform in $\theta$) and the proof are in The general dual theorem.

A Taylor1 computes exactly this integral. With $\theta = \theta_0 + t$, the exponent becomes the truncated series $L(w; \theta_0 + t) = \sum_{i \le n} \partial^i_\theta L\, t^i / i!$, and exp of a truncated series is Faà di Bruno: its $k$-th coefficient is $e^{L} B_k(\{\partial^i_\theta L\}) / k!$. The quadrature of LewisMethod is linear in the integrand, so it sums the multipliers node by node, and the coefficients of the price are the derivatives. The forward term of LewisMethod, which moves the line to $\operatorname{Im} z = 1/2$, is a closed form in $S_0$, $d$ and $T$, differentiated by the same series.

Two families of contracts

Two families of contracts appear in the derivatives of a price:

\[G_k = \mathbb{E}(\Phi(X_T) X_T^k), \qquad D_k = \mathbb{E}(\Phi^{(k)}(X_T))\]

the moment weighted contracts $G_k$, which the likelihood ratio weights produce, and the contracts $D_k$ on the derivatives of the payoff (taken as distributions: for a call, $\Phi''$ has a Dirac mass $K \delta_{\log K}$ at the strike). In the Lewis integral they are two operations on $e^{L}$ (The Fourier dictionary):

primal (price space)dual (frequency space)
contract$G_k$: weighting by $X_T^k$$D_k$: differentiating the payoff $k$ times
in the Lewis integralthe operator $\partial_w^k$ on $e^{L}$the multiplier $w^k$
sensitivity$\sum_i a_i(\theta, n)\, G_i$ when $\log f$ is a polynomial in $x$$\sum_k c_k(\theta, n)\, D_k$ when $\partial^i_\theta L$ is a polynomial in $w$
holds forBlack and Scholes (the Spectral Theorem)$S_0$, $r$, $d$ in every Lévy model, the $\sigma$ of a Brownian component
computed bythe likelihood ratio weights of VibratoMonteCarlo.jl (v_mod)LewisMethod with Taylor1

Black and Scholes satisfies both, because for a Gaussian multiplying by $w$ and differentiating in $w$ are interchangeable (Stein's lemma); by Marcinkiewicz's theorem it is the only law that does (Where the two theorems meet).

Polynomial multipliers

$S_0$, $r$ and $d$ enter $L$ only through the coefficient of $w$, in every Lévy model, so their multipliers are polynomials in $w$, and the sensitivity is the price of the payoff transformed by a differential operator with constant coefficients (The dual theorem):

input$\partial_\theta L$sensitivity of order $n$
$d$$-T w$$\partial^n_d V_0 = (-T)^n e^{-rT}\, \mathbb{E}(\Phi^{(n)}(X_T))$
$r$$T (w - 1)$$\partial^n_r V_0 = T^n e^{-rT}\, \mathbb{E}(((\partial_x - 1)^n \Phi)(X_T))$
$S_0$$w / S_0$$\partial^n_{S_0} V_0 = S_0^{-n} e^{-rT}\, \mathbb{E}((\partial_x (\partial_x - 1) \cdots (\partial_x - n + 1) \Phi)(X_T))$
$\sigma$ of a Brownian component$T \sigma (w^2 - w)$$2 n + 1$ contracts $D_0, \dots, D_{2n}$, with $\mathcal{A} = \partial_x^2 - \partial_x$ (Black and Scholes, Merton, Kou; not Variance Gamma and NIG)

The higher derivatives of $L$ in $d$ and $r$ vanish; those in $S_0$ give the falling factorial. For a call $\Phi(x) = (e^x - K)^+$ the derivatives of the payoff are prices too: $\Phi'(x) = e^x \mathbb{1}_{x > \log K}$ is an asset-or-nothing option, worth $A = C + K B$ with $C$ the call and $B$ the digital (cash-or-nothing) call, and $\Phi'' - \Phi' = K \delta_{\log K}$, whose price is $S_0^2 \Gamma$ by the row of $S_0$. The first two orders in $d$ and $r$ are then relations between the Greeks of a call and the prices of three options, the same in every Lévy model:

\[\partial_d C = -T A, \qquad \partial_r C = T K B, \qquad \partial^2_d C = T^2 (A + S_0^2 \Gamma), \qquad \partial^2_r C = T^2 (S_0^2 \Gamma - K B)\]

Each one checked on three models, the left side by a Taylor1 in $d$, $r$ or $S_0$ through LewisMethod:

using Printf
S0, d, r, T, K = 100.0, 0.01, 0.02, 1.1, 105.0
greeks(model, n, input) = derivatives(x -> pricer(model, Underlying(input == :S0 ? x : S0, input == :d ? x : d), ZeroRate(input == :r ? x : r), method, EuropeanOption(T, K)), input == :S0 ? S0 : input == :d ? d : r, n)
for (name, model) in ("Black–Scholes" => BlackScholesProcess(0.2), "Merton" => MertonProcess(0.2, 5.0, 0.03, 0.02), "Variance Gamma" => VarianceGammaProcess(0.2, -0.1, 0.2))
    C = pricer(model, Underlying(S0, d), ZeroRate(r), method, EuropeanOption(T, K))
    B = pricer(model, Underlying(S0, d), ZeroRate(r), method, BinaryEuropeanOption(T, K))
    A = C + K * B
    Γ = greeks(model, 2, :S0)[3]
    gd, gr = greeks(model, 2, :d), greeks(model, 2, :r)
    errors = (gd[2] + T * A, gr[2] - T * K * B, gd[3] - T^2 * (A + S0^2 * Γ), gr[3] - T^2 * (S0^2 * Γ - K * B))
    @printf("%-15s ∂d C %9.4f  ∂r C %9.4f  ∂²d C %9.4f  ∂²r C %9.4f   largest difference %.0e\n", name, gd[2], gr[2], gd[3], gr[3], maximum(abs, errors))
end
Black–Scholes   ∂d C  -51.1341  ∂r C   43.8171  ∂²d C  283.2138  ∂²r C  178.7675   largest difference 5e-13
Merton          ∂d C  -51.8597  ∂r C   43.8097  ∂²d C  267.1007  ∂²r C  161.8643   largest difference 3e-13
Variance Gamma  ∂d C  -52.2694  ∂r C   45.1054  ∂²d C  302.0284  ∂²r C  194.9160   largest difference 4e-13

The identities make good tests: no closed form of the model is needed, only its prices.

Every other parameter

For the parameters of the exponent $\psi$ the multiplier is not a polynomial: $\theta$ enters $L$ through the law of the process and through the martingale correction,

\[\partial^i_\theta L(w) = T \left(\partial^i_\theta \psi(w) - w\, \partial^i_\theta \psi(1)\right)\]

which vanishes at $w = 0$ and $w = 1$: the bond and the forward do not depend on the model. The multipliers are still explicit, and the theorem holds for every parameter of every model; those of Merton, Kou, Variance Gamma and NIG are derived in The multipliers of the models. Two of them are exact identities in price space:

  • Jump intensity. Merton and Kou are linear in $\lambda$, so $B_n = (\partial_\lambda L)^n$, and $\partial^n_\lambda V_0$ is a combination of prices with $0, \dots, n$ extra jumps and of derivatives of the payoff.
  • Maturity. $L$ is linear in $T$, so $B_n = (\partial_T L)^n$: the generator of $X$ applied $n$ times, the Kolmogorov backward equation.

LewisMethod with a Taylor1 does not need any of them: it evaluates $e^{L} B_n$ from $\psi$ itself, as in the first example. An explicit multiplier pays when it is reused: computed once on the nodes, it prices every payoff, strike and order of a smile with one weighted sum each (Algorithm and properties). This literature calls the approach Fourier Greeks: Eberlein, Glau and Papapantoleon (2010) for the first two orders in $S_0$, De Olivera and Mordecki (2014) up to the third, jump parameters included.

Limits

The integrand behaves like $|\hat\Phi(z)|\, |e^{L}|\, |B_n|$.

  • With a Brownian component (Black and Scholes, Merton, Kou, Heston) $|e^{L}|$ decays like a Gaussian in $\xi$ and every order converges. NIG decays exponentially.

  • The multiplier of $S_0$, and of every parameter of the martingale correction, grows like $|\xi|^n$: a higher order needs a wider range $A$ of LewisMethod for the same accuracy.

  • Variance Gamma decays only like $|\xi|^{-2T/\kappa}$, and $\hat\Phi$ like $|\xi|^{-2}$ for a call and $|\xi|^{-1}$ for a digital. The integral of order $n$ in $S_0$ converges absolutely when

    \[n < 1 + \frac{2 T}{\kappa} \quad \text{(call)}, \qquad n < \frac{2 T}{\kappa} \quad \text{(digital)}\]

    a sufficient condition. At short maturities high orders fail, and even the gamma, as Behrens, Junike and Schoutens (2023) report for Fourier Greeks.

The gamma of a Variance Gamma call with $T = 0.1$ and $\kappa = 0.25$ ($1 + 2T/\kappa = 1.8 < 2$), at the strike where the density of $X_T$ is singular, and its delta, as the range of LewisMethod grows at a constant step:

vg, Tvg = VarianceGammaProcess(0.2, -0.1, 0.25), 0.1
Kvg = S0 * exp((r - d - FinancialFFT.characteristic_exponent_i(1.0, vg)) * Tvg)
for A in (100.0, 400.0, 1600.0, 6400.0)
    g = derivatives(s -> pricer(vg, Underlying(s, d), ZeroRate(r), LewisMethod(A, round(Int, 10A) + 1), EuropeanOption(Tvg, Kvg)), S0, 2)
    @printf("A = %6.0f   delta %.10f   gamma %.6f\n", A, g[2], g[3])
end
A =    100   delta 0.4718488329   gamma 0.141404
A =    400   delta 0.4711414708   gamma 0.248153
A =   1600   delta 0.4710823718   gamma 0.389411
A =   6400   delta 0.4710774926   gamma 0.575846

The delta ($n = 1$) converges, the gamma keeps growing with the range: the price is not twice differentiable in $S_0$ there. It is the smoothness of the true price, seen from the frequency side; VibratoMonteCarlo.jl meets the same limit from the price side, in VibratoSaltando on Variance Gamma (Integrability, and the same limit in Monte Carlo).