Theory 01 Two ways to differentiate an expectation

Pathwise and likelihood ratio methods

pathwiselikelihood ratio

The basic settings

Let's assume we have an underlying stock price varying as a stochastic process called $S_t$ and let's assume without loss of generality that $S_t>0$ a.e..\ In that case we can define as $X_t$ the following:

\[X_t=\log(S_t)\]

Let's assume we want to price and compute the sensitivities of a european option with maturity $T$ and payoff $\phi$.

We can express the price of such option as:

\[V_0=\mathbb{E}(\phi(S_T))\]

or, in function of $X_T$:

\[V_0=\mathbb{E}(\Phi(X_T))\]

Where:

\[\Phi(x)=\phi(e^x)\]

Pathwise Method

The pathwise method and the likelihood ratio method are the two classic direct estimators of sensitivities (Broadie and Glasserman, 1996), see also (Glasserman, 2004).

Since:

\[V_0=\mathbb{E}(\Phi(X_T))\]

\[\partial_\theta V_0=\partial_\theta \mathbb{E}(\Phi(X_T)) = \mathbb{E}(\dfrac{\partial \Phi(X_T)}{\partial X_T}\dfrac{\partial X_T}{\partial \theta})\]

Where the following is called tangent process:

\[Y_t=\dfrac{\partial X_t}{\partial \theta}\]

In case of a European Option with maturity $T$ and strike price $K$:

\[\Phi(x) = max(e^x-K,0)\]

and:

\[\dfrac{\partial \Phi(x)}{\partial x} = e^x \mathbb{1}_{ e^{x} > K } (x)\]

Hence:

\[\partial_\theta V_0=\mathbb{E}(\dfrac{\partial \Phi(X_T)}{\partial X_T}\dfrac{\partial X_T}{\partial \theta})\]

Unfortunately this method does not provide usefull results for binary options or for n-th order sensitivities, indeed in case of binary options we have:

\[\Phi(x)=\mathbb{1}(x)\]

Hence:

\[\partial_x \Phi(x)=0\]

Likelihood Ratio Method

Starting from the price of the basic settings, if we develop the integral:

\[V_0=\mathbb{E}(\Phi(X_T))=\int_{\mathbb{R}} \Phi(x) f(x) dx\]

where the following is the density of the log yield:

\[f(x)=f_{X_T}(x)\]

If we differentiate for a generic parameter $\theta$:

\[\partial_\theta V_0=\partial_\theta \int_{\mathbb{R}} \Phi(x) f(x,\theta) dx = \int_{\mathbb{R}} \Phi(x) \partial_\theta f(x,\theta) dx\]

or:

\[\partial_\theta V_0 = \int_{\mathbb{R}} \Phi(x) \partial_\theta(\log(f(x,\theta))) f(x,\theta) dx\]

or:

\[\partial_\theta V_0 = \mathbb{E}(\Phi(X_T) \partial_\theta \log(f(X_T,\theta)))\]

In case of n-th order sensitivities:

We observe that for a generic positive differentiable function f we can have:

\[g(x,\theta) = \log{f(x,\theta)}\]

or:

\[f(x,\theta) = e^{g(x,\theta)}\]

Then, according to Faa di Bruno's formula:

\[\partial^{n}_{\theta} e^{g(x,\theta)} = e^{g(x,\theta)} B_n(\{\partial^{i}_{\theta} g(x,\theta)\}_{i = 1 : n})\]

Where $B_n$ is the complete exponential Bell polynomial of n-th order.

Bell polynomials up to order 6

\[B_0 = 1\]

\[B_1(x_1) = x_1\]

\[B_2(x_1,x_2) = x_1^2 + x_2\]

\[B_3(x_1,x_2,x_3) = x_1^3 + 3 x_1 x_2 + x_3\]

\[B_4(x_1,x_2,x_3,x_4) = x_1^4 + 6 x_1^2 x_2 + 3 x_2^2 + 4 x_1 x_3 + x_4\]

\[B_5(x_1,x_2,x_3,x_4,x_5) = x_1^5 + 10 x_1^3 x_2 + 15 x_1 x_2^2 + 10 x_1^2 x_3 + 10 x_2 x_3 + 5 x_1 x_4 + x_5\]

\[B_6(x_1,x_2,x_3,x_4,x_5,x_6) = x_1^6 + 15 x_1^4 x_2 + 45 x_1^2 x_2^2 + 20 x_1^3 x_3 + 15 x_2^3 + 60 x_1 x_2 x_3 + 15 x_1^2 x_4 + 10 x_3^2 + 15 x_2 x_4 + 6 x_1 x_5 + x_6\]

Hence:

\[\partial^{n}_{\theta} f(x,\theta) = f(x,\theta) B_n(\{\partial^{i}_{\theta} \log{f(x,\theta)}\}_{i = 1 : n})\]

By applying this to the original problem:

\[\partial^{n}_{\theta} V_0=\partial^{n}_{\theta} \int_{\mathbb{R}} \Phi(x) f(x,\theta) dx = \int_{\mathbb{R}} \Phi(x) \partial^{n}_{\theta} f(x,\theta) dx\]

By applying the previous result:

\[\partial^{n}_{\theta} V_0= \int_{\mathbb{R}} \Phi(x) f(x,\theta) B_n(\{\partial^{i}_{\theta} \log{f(x,\theta)}\}_{i = 1 : n}) dx\]

or, in terms of expectation:

\[\partial^{n}_{\theta} V_0 = \mathbb{E}(\Phi(X_T) B_n(\{\partial^{i}_{\theta} \log{f(X_T,\theta)}\}_{i = 1 : n}))\]

Likelihood Ratio Method for Black and Scholes

In case of trivial models the density is known in analytic form, otherwise one need to compute it numerically from the characteristic function. In case of the Black and Scholes Model (Black and Scholes, 1973), and a European Option we have the following:

\[X_t=\log(S_0)+(r-d-\dfrac{\sigma^2}{2}) t + \sigma W_t\]

\[\log(f(x,S_0,r,d,\sigma,T)) = -\dfrac{1}{2}((\dfrac{x-(\log(S_0)+(r-d-\dfrac{\sigma^2}{2}) T)}{\sigma \sqrt{T}})^2 + \log(2 \pi)) - \log(\sigma\sqrt{T})\]

From this we can compute the various partial derivatives. Calling $\delta = \sqrt{T}$ and:

\[Z = \frac{x - \log(S_0) - (r-d-\frac{\sigma^2}{2}) T}{\sigma \delta}\]

which is a standard normal when $x = X_T$, Symbolics.jl generates from the log_density of the package:

\[\partial_{S_0} \log f = \frac{Z}{S_0 \delta \sigma}\]

\[\partial_{r} \log f = \frac{Z \delta}{\sigma}\]

\[\partial_{d} \log f = \frac{ - Z \delta}{\sigma}\]

\[\partial_{\sigma} \log f = \frac{-1 + Z^{2} - Z \delta \sigma}{\sigma}\]

\[\partial_{T} \log f = \frac{ - \sigma + Z^{2} \sigma - 2 Z d \delta + 2 Z r \delta - \sigma^{2} Z \delta}{2 \delta^{2} \sigma}\]

Hence, a delta for a generic european option can be computed as the following expectation:

\[\Delta = \partial_{S_0} V_0 = \mathbb{E}\left(\Phi(X_T) \frac{Z}{S_0 \delta \sigma}\right)\]

or, in terms of $W_T$:

\[\frac{\partial V}{\partial\theta} = \mathbb{E}\left( \frac{W_T \Phi\left( \log\left( S_0 \right) + W_T \sigma + T \left( - d + r - \frac{1}{2} \sigma^{2} \right) \right)}{S_0 T \sigma} \right)\]

Let's assume now that $\Phi$ is a forward i.e.:

\[\Phi(x)=e^x\]

Since $\Delta = e^{(r-d)T}$:

\[\mathbb{E}(e^{-\frac{\sigma^2}{2} T + \sigma W_T}\,W_T) = \sigma T\]

Spectral Theorem for Black and Scholes

The scores above are polynomials of degree at most 2 in $x$, so the weight of order $n$ is a polynomial of degree $2n$ in $X_T$, and every sensitivity of order $n$ is a combination, with coefficients that do not depend on the payoff, of the prices of the $2n + 1$ contracts $\mathbb{E}(\Phi(X_T) X_T^i)$. This is the Spectral Theorem; its statement, its proof, its dual version in frequency space and the link with FinancialFFT.jl are in The Spectral Theorem.