# Moment-generating function

In probability theory and statistics, the moment-generating function of a random variable X is

$M_{X}(t)=E\left(e^{tX}\right),\quad t\in \mathbb {R} ,$ wherever this expectation exists. The moment-generating function generates the moments of the probability distribution.

For vector-valued random variables X with real components, the moment-generating function is given by

$M_{X}(\mathbf {t} )=E\left(e^{\langle \mathbf {t} ,\mathbf {X} \rangle }\right)$ where t is a vector and $\langle \mathbf {t} ,\mathbf {X} \rangle$ is the dot product.

Provided the moment-generating function exists in an interval around t = 0, the nth moment is given by

$E\left(X^{n}\right)=M_{X}^{(n)}(0)=\left.{\frac {\mathrm {d} ^{n}M_{X}(t)}{\mathrm {d} t^{n}}}\right|_{t=0}.$ If X has a continuous probability density function f(x) then the moment generating function is given by

$M_{X}(t)=\int _{-\infty }^{\infty }e^{tx}f(x)\,\mathrm {d} x$ $=\int _{-\infty }^{\infty }\left(1+tx+{\frac {t^{2}x^{2}}{2!}}+\cdots \right)f(x)\,\mathrm {d} x$ $=1+tm_{1}+{\frac {t^{2}m_{2}}{2!}}+\cdots ,$ where $m_{i}$ is the ith moment. $M_{X}(-t)$ is just the two-sided Laplace transform of f(x).

Regardless of whether the probability distribution is continuous or not, the moment-generating function is given by the Riemann-Stieltjes integral

$M_{X}(t)=\int _{-\infty }^{\infty }e^{tx}\,dF(x)$ where F is the cumulative distribution function.

If X1, X2, ..., Xn is a sequence of independent (and not necessarily identically distributed) random variables, and

$S_{n}=\sum _{i=1}^{n}a_{i}X_{i},$ where the ai are constants, then the probability density function for Sn is the convolution of the probability density functions of each of the Xi and the moment-generating function for Sn is given by

$M_{S_{n}}(t)=M_{X_{1}}(a_{1}t)M_{X_{2}}(a_{2}t)\cdots M_{X_{n}}(a_{n}t).$ Related to the moment-generating function are a number of other transforms that are common in probability theory, including the characteristic function and the probability-generating function.

The cumulant-generating function is the logarithm of the moment-generating function. 