# Exponential tilting

Exponential Tilting (ET), Exponential Twisting, or Exponential Change of Measure (ECM) is a distribution shifting technique used in many parts of mathematics. The different exponential tiltings of a random variable $X$ is known as the natural exponential family of $X$.
Exponential Tilting is used in Monte Carlo Estimation for rare-event simulation, and rejection and importance sampling in particular. In mathematical finance Exponential Tilting is also known as Esscher tilting (or the Esscher transform), and often combined with indirect Edgeworth approximation and is used in such contexts as insurance futures pricing.
The earliest formalization of Exponential Tilting is often attributed to Esscher with its use in importance sampling being attributed to David Siegmund.

## Overview

Given a random variable $X$ with probability distribution $\mathbb {P}$, density $f$, and moment generating function (MGF) $M_{X}(\theta )=\mathbb {E} [e^{\theta X}]<\infty$, the exponentially tilted measure $\mathbb {P} _{\theta }$ is defined as follows:
    $\mathbb {P} _{\theta }(X\in dx)={\frac {\mathbb {E} [e^{\theta X}\mathbb {I} [X\in dx]]}{M_{X}(\theta )}}=e^{\theta x-\kappa (\theta )}\mathbb {P} (X\in dx),$
where $\kappa (\theta )$ is the cumulant generating function (CGF) defined as
    $\kappa (\theta )=\log \mathbb {E} [e^{\theta X}]=\log M_{X}(\theta ).$
We call
    $\mathbb {P} _{\theta }(X\in dx)=f_{\theta }(x)$
the $\theta$-tilted density of $X$. It satisfies $f_{\theta }(x)\propto e^{\theta x}f(x)$.
The exponential tilting of a random vector $X$ has an analogous definition:
    $\mathbb {P} _{\theta }(X\in dx)=e^{\theta ^{T}x-\kappa (\theta )}\mathbb {P} (X\in dx),$
where $\kappa (\theta )=\log \mathbb {E} [\exp\{\theta ^{T}X\}]$.

### Example

The exponentially tilted measure in many cases has the same parametric form as that of $X$. One-dimensional examples include the normal distribution, the exponential distribution, the binomial distribution and the Poisson distribution.
For example, in the case of the normal distribution, $N(\mu ,\sigma ^{2})$ the tilted density $f_{\theta }(x)$ is the $N(\mu +\theta \sigma ^{2},\sigma ^{2})$ density. The table below provides more examples of tilted densities.
| Original distribution | θ-Tilted distribution |
| $\mathrm {Gamma} (\alpha ,\beta )$ | $\mathrm {Gamma} (\alpha ,\beta -\theta )$ |
| $\mathrm {Binomial} (n,p)$ | $\mathrm {Binomial} \left(n,{\frac {pe^{\theta }}{1-p+pe^{\theta }}}\right)$ |
| $\mathrm {Poisson} (\lambda )$ | $\mathrm {Poisson} (\lambda e^{\theta })$ |
| $\mathrm {Exponential} (\lambda )$ | $\mathrm {Exponential} (\lambda -\theta )$ |
| ${\mathcal {N}}(\mu ,\sigma ^{2})$ | ${\mathcal {N}}(\mu +\theta \sigma ^{2},\sigma ^{2})$ |
| ${\mathcal {N}}(\mu ,\Sigma )$ | ${\mathcal {N}}(\mu +\Sigma \theta ,\Sigma )$ |
| $\chi ^{2}(\kappa )$ | $\mathrm {Gamma} \left({\frac {\kappa }{2}},{\frac {2}{1-2\theta }}\right)$ |
For some distributions, however, the exponentially tilted distribution does not belong to the same parametric family as $f$. An example of this is the Pareto distribution with $f(x)=\alpha /(1+x)^{\alpha },x>0$, where $f_{\theta }(x)$ is well defined for $\theta <0$ but is not a standard distribution. In such examples, the random variable generation may not always be straightforward.
In statistical mechanics, the energy of a system in equilibrium with a heat bath has the Boltzmann distribution: $\mathbb {P} (E\in dE)\propto e^{-\beta E}dE$, where $\beta$ is the inverse temperature. Exponential tilting then corresponds to changing the temperature: $\mathbb {P} _{\theta }(E\in dE)\propto e^{-(\beta -\theta )E}dE$.
Similarly, the energy and particle number of a system in equilibrium with a heat and particle bath has the grand canonical distribution: $\mathbb {P} ((N,E)\in (dN,dE))\propto e^{\beta \mu N-\beta E}dNdE$, where $\mu$ is the chemical potential. Exponential tilting then corresponds to changing both the temperature and the chemical potential.

### Advantages

In many cases, the tilted distribution belongs to the same parametric family as the original. This is particularly true when the original density belongs to the exponential family of distribution. This simplifies random variable generation during Monte-Carlo simulations. Exponential tilting may still be useful if this is not the case, though normalization must be possible and additional sampling algorithms may be needed.
In addition, there exists a simple relationship between the original and tilted CGF,
    $\kappa _{\theta }(\eta )=\log(\mathbb {E} _{\theta }[e^{\eta X}])=\kappa (\theta +\eta )-\kappa (\theta ).$
We can see this by observing that
    $F_{\theta }(x)=\int \limits _{\infty }^{x}\exp\{\theta y-\kappa (\theta )\}f(y)dy.$
Thus,
    ${\begin{aligned}\kappa _{\theta }(\eta )&=\log \int e^{\eta x}dF_{\theta }(x)\\&=\log \int e^{\eta x}e^{\theta x-\kappa (\theta )}dF(x)\\&=\log \mathbb {E} [e^{(\eta +\theta )X-\kappa (\theta )}]\\&=\log(e^{\kappa (\eta +\theta )-\kappa (\theta )})\\&=\kappa (\eta +\theta )-\kappa (\theta )\end{aligned}}$.
Clearly, this relationship allows for easy calculation of the CGF of the tilted distribution and thus the distributions moments. Moreover, it results in a simple form of the likelihood ratio. Specifically,
    $\ell ={\frac {d\mathbb {P} }{d\mathbb {P} _{\theta }}}={\frac {f(x)}{f_{\theta }(x)}}=e^{-\theta x+\kappa (\theta )}$.

## Properties

* If $\kappa (\eta )=\log \mathrm {E} [\exp(\eta X)]$ is the CGF of $X$, then the CGF of the $\theta$-tilted $X$ is
       $\kappa _{\theta }(\eta )=\kappa (\theta +\eta )-\kappa (\theta ).$
    This means that the $i$-th cumulant of the tilted $X$ is $\kappa ^{(i)}(\theta )$. In particular, the expectation of the tilted distribution is
       $\mathrm {E} _{\theta }[X]={\tfrac {d}{d\eta }}\kappa _{\theta }(\eta )|_{\eta =0}=\kappa '(\theta )$.
    The variance of the tilted distribution is
       $\mathrm {Var} _{\theta }[X]={\tfrac {d^{2}}{d\eta ^{2}}}\kappa _{\theta }(\eta )|_{\eta =0}=\kappa ''(\theta )$.
* Repeated tilting is additive. That is, tilting first by $\theta _{1}$ and then $\theta _{2}$ is the same as tilting once by $\theta _{1}+\theta _{2}$.
* If $X$ is the sum of independent, but not necessarily identical random variables $X_{1},X_{2},\dots$, then the $\theta$-tilted distribution of $X$ is the sum of $X_{1},X_{2},\dots$ each $\theta$-tilted individually.
* If $\mu =\mathrm {E} [X]$, then $\kappa (\theta )-\theta \mu$ is the Kullback–Leibler divergence
       $D_{\text{KL}}(P\parallel P_{\theta })=\mathrm {E} \left[\log {\tfrac {P}{P_{\theta }}}\right]$
    between the tilted distribution $P_{\theta }$ and the original distribution $P$ of $X$.
* Similarly, since $\mathrm {E} _{\theta }[X]=\kappa '(\theta )$, we have the Kullback-Leibler divergence as
       $D_{\text{KL}}(P_{\theta }\parallel P)=\mathrm {E} _{\theta }\left[\log {\tfrac {P_{\theta }}{P}}\right]=\theta \kappa '(\theta )-\kappa (\theta )$.

## Applications
### Rare-event simulation

The exponential tilting of $X$, assuming it exists, supplies a family of distributions that can be used as proposal distributions for acceptance-rejection sampling or importance distributions for importance sampling. One common application is sampling from a distribution conditional on a sub-region of the domain, i.e. $X|X\in A$. With an appropriate choice of $\theta$, sampling from $\mathbb {P} _{\theta }$ can meaningfully reduce the required amount of sampling or the variance of an estimator.

### Saddlepoint approximation

The saddlepoint approximation method is a density approximation methodology often used for the distribution of sums and averages of independent, identically distributed random variables that employs Edgeworth series, but which generally performs better at extreme values. From the definition of the natural exponential family, it follows that
    $f_{\theta }({\bar {x}})=f({\bar {x}})\exp\{n(\theta {\bar {x}}-\kappa (\theta ))\}$.
Applying the Edgeworth expansion for $f_{\theta }({\bar {x}})$, we have
    $f_{\theta }({\bar {x}})=\psi (z)(\mathrm {Var} [{\bar {X}}])^{-1/2}\left\{1+{\frac {\rho _{3}(\theta )h_{3}(z)}{6}}+{\frac {\rho _{4}(\theta )h_{4}(z)}{24}}\dots \right\},$
where $\psi (z)$ is the standard normal density of
    $z={\frac {{\bar {x}}-\kappa _{\bar {x}}'(\theta )}{\kappa _{\bar {x}}''(\theta )}}$,
    $\rho _{n}(\theta )=\kappa ^{(n)}(\theta )\{\kappa ''(\theta )^{n/2}\}$,
and $h_{n}$ are the hermite polynomials.
When considering values of ${\bar {x}}$ progressively farther from the center of the distribution, $|z|\rightarrow \infty$ and the $h_{n}(z)$ terms become unbounded. However, for each value of ${\bar {x}}$, we can choose $\theta$ such that
       $\kappa '(\theta )={\bar {x}}.$
This value of $\theta$ is referred to as the saddle-point, and the above expansion is always evaluated at the expectation of the tilted distribution. This choice of $\theta$ leads to the final representation of the approximation given by
    $f({\bar {x}})\approx \left({\frac {n}{2\pi \kappa ''(\theta )}}\right)^{1/2}\exp\{n(\kappa (\theta )-\theta {\bar {x}})\}.$

### Rejection sampling

Using the tilted distribution $\mathbb {P} _{\theta }$ as the proposal, the rejection sampling algorithm prescribes sampling from $f_{\theta }(x)$ and accepting with probability
    ${\frac {1}{c}}\exp(-\theta x+\kappa (\theta )),$
where
    $c=\sup \limits _{x\in X}{\frac {d\mathbb {P} }{d\mathbb {P} _{\theta }}}(x).$
That is, a uniformly distributed random variable $p\sim {\mbox{Unif}}(0,1)$ is generated, and the sample from $f_{\theta }(x)$ is accepted if
    $p\leq {\frac {1}{c}}\exp(-\theta x+\kappa (\theta )).$

### Importance sampling

Applying the exponentially tilted distribution as the importance distribution yields the equation
    $\mathbb {E} (h(X))=\mathbb {E} _{\theta }[\ell (X)h(X)]$,
where
    $\ell (X)={\frac {d\mathbb {P} }{d\mathbb {P} _{\theta }}}$
is the likelihood function. So, one samples from $f_{\theta }$ to estimate the probability under the importance distribution $\mathbb {P} (dX)$ and then multiplies it by the likelihood ratio. Moreover, we have the variance given by
    ${\mbox{Var}}(X)=\mathbb {E} [(\ell (X)h(X)^{2}]$.

#### Example

Assume independent and identically distributed $\{X_{i}\}$ such that $\kappa (\theta )<\infty$. In order to estimate $\mathbb {P} (X_{1}+\cdots +X_{n}>c)$, we can employ importance sampling by taking
    $h(X)=\mathbb {I} (\sum _{i=1}^{n}X_{i}>c)$.
The constant $c$ can be rewritten as $na$ for some other constant $a$. Then,
    $\mathbb {P} (\sum _{i=1}^{n}X_{i}>na)=\mathbb {E} _{\theta _{a}}\left[\exp\{-\theta _{a}\sum _{i=1}^{n}X_{i}+n\kappa (\theta _{a})\}\mathbb {I} (\sum _{i=1}^{n}X_{i}>na)\right]$,
where $\theta _{a}$ denotes the $\theta$ defined by the saddle-point equation
    $\kappa '(\theta _{a})=a$.

### Stochastic processes

Given the tilting of a normal R.V., it is intuitive that the exponential tilting of $X_{t}$, a Brownian motion with drift $\mu$ and variance $\sigma ^{2}$, is a Brownian motion with drift $\mu +\theta \sigma ^{2}$ and variance $\sigma ^{2}$. Thus, any Brownian motion with drift under $\mathbb {P}$ can be thought of as a Brownian motion without drift under $\mathbb {P} _{\theta ^{*}}$. To observe this, consider the process $X_{t}=B_{t}+\mu _{t}$. $f(X_{t})=f_{\theta ^{*}}(X_{t}){\frac {d\mathbb {P} }{d\mathbb {P} _{\theta ^{*}}}}=f(B_{t})\exp\{\mu B_{T}-{\frac {1}{2}}\mu ^{2}T\}$. The likelihood ratio term, $\exp\{\mu B_{T}-{\frac {1}{2}}\mu ^{2}T\}$, is a martingale and commonly denoted $M_{T}$. Thus, a Brownian motion with drift process (as well as many other continuous processes adapted to the Brownian filtration) is a $\mathbb {P} _{\theta ^{*}}$-martingale.

#### Stochastic Differential Equations

The above leads to the alternate representation of the stochastic differential equation $dX(t)=\mu (t)dt+\sigma (t)dB(t)$: $dX_{\theta }(t)=\mu _{\theta }(t)dt+\sigma (t)dB(t)$, where $\mu _{\theta }(t)$ = $\mu (t)+\theta \sigma (t)$. Girsanov's Formula states the likelihood ratio ${\frac {d\mathbb {P} }{d\mathbb {P} _{\theta }}}=\exp\{-\int \limits _{0}^{T}{\frac {\mu _{\theta }(t)-\mu (t)}{\sigma ^{2}(t)}}dB(t)+\int \limits _{0}^{T}({\frac {\sigma ^{2}(t)}{2}})dt\}$. Therefore, Girsanov's Formula can be used to implement importance sampling for certain SDEs.
Tilting can also be useful for simulating a process $X(t)$ via rejection sampling of the SDE $dX(t)=\mu (X(t))dt+dB(t)$. We may focus on the SDE since we know that $X(t)$ can be written $\int \limits _{0}^{t}dX(t)+X(0)$. As previously stated, a Brownian motion with drift can be tilted to a Brownian motion without drift. Therefore, we choose $\mathbb {P} _{proposal}=\mathbb {P} _{\theta ^{*}}$. The likelihood ratio ${\frac {d\mathbb {P} _{\theta ^{*}}}{d\mathbb {P} }}(dX(s):0\leq s\leq t)=$ $\prod \limits _{\tau \geq t}\exp\{\mu (X(\tau ))dX(\tau )-{\frac {\mu (X(\tau ))^{2}}{2}}\}dt=\exp\{\int \limits _{0}^{t}\mu (X(\tau ))dX(\tau )-\int \limits _{0}^{t}{\frac {\mu (X(s))^{2}}{2}}\}dt$. This likelihood ratio will be denoted $M(t)$. To ensure this is a true likelihood ratio, it must be shown that $\mathbb {E} [M(t)]=1$. Assuming this condition holds, it can be shown that $f_{X(t)}(y)=f_{X(t)}^{\theta ^{*}}(y)\mathbb {E} _{\theta ^{*}}[M(t)|X(t)=y]$. So, rejection sampling prescribes that one samples from a standard Brownian motion and accept with probability ${\frac {f_{X(t)}(y)}{f_{X(t)}^{\theta ^{*}}(y)}}{\frac {1}{c}}={\frac {1}{c}}\mathbb {E} _{\theta ^{*}}[M(t)|X(t)=y]$.

## Choice of tilting parameter
### Siegmund's algorithm

Assume i.i.d. X's with light tailed distribution and $\mathbb {E} [X]>0$. In order to estimate $\psi (c)=\mathbb {P} (\tau (c)<\infty )$ where $\tau (c)=\inf\{t:\sum \limits _{i=1}^{t}X_{i}>c\}$, when $c$ is large and hence $\psi (c)$ small, the algorithm uses exponential tilting to derive the importance distribution. The algorithm is used in many aspects, such as sequential tests, G/G/1 queue waiting times, and $\psi$ is used as the probability of ultimate ruin in ruin theory. In this context, it is logical to ensure that $\mathbb {P} _{\theta }(\tau (c)<\infty )=1$. The criterion $\theta >\theta _{0}$, where $\theta _{0}$ is s.t. $\kappa '(\theta _{0})=0$ achieves this. Siegmund's algorithm uses $\theta =\theta ^{*}$, if it exists, where $\theta ^{*}$ is defined in the following way: $\kappa (\theta ^{*})=0$. It has been shown that $\theta ^{*}$ is the only tilting parameter producing bounded relative error (${\underset {x\rightarrow \infty }{\lim \sup }}{\frac {Var\mathbb {I} _{A(x)}}{\mathbb {P} A(x)^{2}}}<\infty$).

### Black-Box algorithms

We can only see the input and output of a black box, without knowing its structure. The algorithm is to use only minimal information on its structure. When we generate random numbers, the output may not be within the same common parametric class, such as normal or exponential distributions. An automated way may be used to perform ECM. Let $X_{1},X_{2},...$be i.i.d. r.v.’s with distribution $G$; for simplicity we assume $X\geq 0$. Define ${\mathfrak {F}}_{n}=\sigma (X_{1},...,X_{n},U_{1},...,U_{n})$, where $U_{1},U_{2}$, . . . are independent (0, 1) uniforms. A randomized stopping time for $X_{1},X_{2}$, . . . is then a stopping time w.r.t. the filtration $\{{\mathfrak {F}}_{n}\}$, . . . Let further ${\mathfrak {G}}$ be a class of distributions $G$ on $[0,\infty )$ with $k_{G}=\int _{0}^{\infty }e^{\theta x}G(dx)<\infty$ and define $G_{\theta }$ by ${\frac {dG_{\theta }}{dG(x)}}=e^{\theta x-k_{G}}$. We define a black-box algorithm for ECM for the given $\theta$ and the given class ${\mathfrak {G}}$of distributions as a pair of a randomized stopping time $\tau$ and an ${\mathfrak {F}}_{\tau }-$ measurable r.v. $Z$ such that $Z$ is distributed according to $G_{\theta }$ for any $G\in {\mathfrak {G}}$. Formally, we write this as $\mathbb {P} _{G}(Z<x)=G_{\theta }(x)$ for all $x$. In other words, the rules of the game are that the algorithm may use simulated values from $G$ and additional uniforms to produce an r.v. from $G_{\theta }$.