# Isserlis' theorem

In probability theory, Isserlis' theorem or Wick's probability theorem is a formula that allows one to compute higher-order moments of the multivariate normal distribution in terms of its covariance matrix. It is named after Leon Isserlis.
This theorem is also particularly important in particle physics, where it is known as Wick's theorem after the work of Wick (1950). Other applications include the analysis of portfolio returns, quantum field theory and generation of colored noise.

## Statement

If $(X_{1},\dots ,X_{n})$ is a zero-mean multivariate normal random vector, then$\operatorname {E} [\,X_{1}X_{2}\cdots X_{n}\,]=\sum _{p\in P_{n}^{2}}\prod _{\{i,j\}\in p}\operatorname {E} [\,X_{i}X_{j}\,]=\sum _{p\in P_{n}^{2}}\prod _{\{i,j\}\in p}\operatorname {Cov} (\,X_{i},X_{j}\,),$where the sum is over all the pairings of $\{1,\ldots ,n\}$, i.e. all distinct ways of partitioning $\{1,\ldots ,n\}$ into pairs $\{i,j\}$, and the product is over the pairs contained in $p$.
More generally, if $(Z_{1},\dots ,Z_{n})$ is a zero-mean complex-valued multivariate normal random vector, then the formula still holds.
The expression on the right-hand side is also known as the hafnian of the covariance matrix of $(X_{1},\dots ,X_{n})$.

### Odd case

If $n=2m+1$ is odd, there does not exist any pairing of $\{1,\ldots ,2m+1\}$. Under this hypothesis, Isserlis' theorem implies that$\operatorname {E} [\,X_{1}X_{2}\cdots X_{2m+1}\,]=0.$ This also follows from the fact that $-X=(-X_{1},\dots ,-X_{n})$ has the same distribution as $X$, which implies that $\operatorname {E} [\,X_{1}\cdots X_{2m+1}\,]=\operatorname {E} [\,(-X_{1})\cdots (-X_{2m+1})\,]=-\operatorname {E} [\,X_{1}\cdots X_{2m+1}\,]=0$.

### Even case

In his original paper, Leon Isserlis proves this theorem by mathematical induction, generalizing the formula for the $4^{\text{th}}$ order moments, which takes the appearance
    $\operatorname {E} [\,X_{1}X_{2}X_{3}X_{4}\,]=\operatorname {E} [X_{1}X_{2}]\,\operatorname {E} [X_{3}X_{4}]+\operatorname {E} [X_{1}X_{3}]\,\operatorname {E} [X_{2}X_{4}]+\operatorname {E} [X_{1}X_{4}]\,\operatorname {E} [X_{2}X_{3}].$
If $n=2m$ is even, there exist $(2m)!/(2^{m}m!)=(2m-1)!!$ (see double factorial) pair partitions of $\{1,\ldots ,2m\}$: this yields $(2m)!/(2^{m}m!)=(2m-1)!!$ terms in the sum. For example, for $4^{\text{th}}$ order moments (i.e. $4$ random variables) there are three terms. For $6^{\text{th}}$-order moments there are $3\times 5=15$ terms, and for $8^{\text{th}}$-order moments there are $3\times 5\times 7=105$ terms.

### Example

We can evaluate the characteristic function of gaussians by the Isserlis theorem:$E[e^{-iX}]=\sum _{k}{\frac {(-i)^{k}}{k!}}E[X^{k}]=\sum _{k}{\frac {(-i)^{2k}}{(2k)!}}E[X^{2k}]=\sum _{k}{\frac {(-i)^{2k}}{(2k)!}}{\frac {(2k)!}{k!2^{k}}}E[X^{2}]^{k}=e^{-{\frac {1}{2}}E[X^{2}]}$

## Proof

Since both sides of the formula are multilinear in $X_{1},...,X_{n}$, if we can prove the real case, we get the complex case for free.
Let $\Sigma _{ij}=\operatorname {Cov} (X_{i},X_{j})$ be the covariance matrix, so that we have the zero-mean multivariate normal random vector $(X_{1},...,X_{n})\sim N(0,\Sigma )$. Since both sides of the formula are continuous with respect to $\Sigma$, it suffices to prove the case when $\Sigma$ is invertible.
Using quadratic factorization $-x^{T}\Sigma ^{-1}x/2+v^{T}x-v^{T}\Sigma v/2=-(x-\Sigma v)^{T}\Sigma ^{-1}(x-\Sigma v)/2$, we get
${\frac {1}{\sqrt {(2\pi )^{n}\det \Sigma }}}\int e^{-x^{T}\Sigma ^{-1}x/2+v^{T}x}dx=e^{v^{T}\Sigma v/2}$
Differentiate under the integral sign with $\partial _{v_{1},...,v_{n}}|_{v_{1},...,v_{n}=0}$ to obtain
$E[X_{1}\cdots X_{n}]=\partial _{v_{1},...,v_{n}}|_{v_{1},...,v_{n}=0}e^{v^{T}\Sigma v/2}$.
That is, we need only find the coefficient of term $v_{1}\cdots v_{n}$ in the Taylor expansion of $e^{v^{T}\Sigma v/2}$.
If $n$ is odd, this is zero. So let $n=2m$, then we need only find the coefficient of term $v_{1}\cdots v_{n}$ in the polynomial ${\frac {1}{m!}}(v^{T}\Sigma v/2)^{m}$.
Expand the polynomial and count, we obtain the formula. $\square$

## Generalizations
### Gaussian integration by parts

An equivalent formulation of the Wick's probability formula is the Gaussian integration by parts. If $(X_{1},\dots X_{n})$ is a zero-mean multivariate normal random vector, then
$\operatorname {E} (X_{1}f(X_{1},\ldots ,X_{n}))=\sum _{i=1}^{n}\operatorname {Cov} (X_{1},X_{i})\operatorname {E} (\partial _{X_{i}}f(X_{1},\ldots ,X_{n})).$This is a generalization of Stein's lemma.
The Wick's probability formula can be recovered by induction, considering the function $f:\mathbb {R} ^{n}\to \mathbb {R}$ defined by $f(x_{1},\ldots ,x_{n})=x_{2}\ldots x_{n}$. Among other things, this formulation is important in Liouville conformal field theory to obtain conformal Ward identities, BPZ equations and to prove the Fyodorov-Bouchaud formula.

### Non-Gaussian random variables

For non-Gaussian random variables, the moment-cumulants formula replaces the Wick's probability formula. If $(X_{1},\dots X_{n})$ is a vector of random variables, then $\operatorname {E} (X_{1}\ldots X_{n})=\sum _{p\in P_{n}}\prod _{b\in p}\kappa {\big(X_{i})_{i\in b}{\big )},$where the sum is over all the partitions of $\{1,\ldots ,n\}$, the product is over the blocks of $p$ and $\kappa {\big(X_{i})_{i\in b}{\big )}$ is the joint cumulant of $(X_{i})_{i\in b}$.

### Uniform distribution on the unit sphere

Consider $X=(X_{1},\dots ,X_{d})$ uniformly distributed on the unit sphere $S^{d-1}$, so that $\|X\|=1$ almost surely. In this setting, the following holds.
If $n$ is odd, $\operatorname {E} {\biglX_{i_{1}}\,X_{i_{2}}\,\cdots \,X_{i_{n}}{\bigr ]}\;=\;0.\!$
If $n=2k$ is even, $\operatorname {E} {\biglX_{i_{1}}\,\cdots \,X_{i_{2k}}{\bigr ]}\;=\;{\frac {1}{d\,{\bigld+2{\bigr )}{\bigld+4{\bigr )}\cdots {\bigld+2k-2{\bigr )}}}\sum _{p\in P_{2k}^{2}}\prod _{\{r,s\}\in p}\delta _{\,i_{r},i_{s}},$ where $P_{2k}^{2}$ is the set of all pairings of $\{1,\ldots ,2k\}$, $\delta _{i,j}$ is the Kronecker delta.
Since there are $|P_{2k}^{2}|=(2k-1)!!$ delta-terms, we get on the diagonal: $\operatorname {E} [\,X_{1}^{2k}\,]\;=\;{\frac {(2k-1)!!}{d\,{\bigld+2{\bigr )}{\bigld+4{\bigr )}\cdots {\bigld+2k-2{\bigr )}}}.$ Here, $(2k-1)!!$ denotes the double factorial.
These results are discussed in the context of random vectors and irreducible representations in the work by Kushkuley (2021).