A moment generating function packs all of a distribution's moments, $E[X], E[X^{2}], \ldots$, into one function. It turns the hard convolution of independent variables into a simple product, and it is the main tool for proving the central limit theorem. The key fact is the exponential series from known series, and the moments are the expected values of functions you already compute.
Key idea
Why it works
| Distribution | $M(t)$ | Mean | Variance |
|---|---|---|---|
| Bernoulli($p$) | $1 - p + pe^{t}$ | $p$ | $p(1 - p)$ |
| Binomial($n, p$) | $(1 - p + pe^{t})^{n}$ | $np$ | $np(1 - p)$ |
| Poisson($\lambda$) | $e^{\lambda(e^{t} - 1)}$ | $\lambda$ | $\lambda$ |
| Exponential (rate $\lambda$) | $\frac{\lambda}{\lambda - t}$, $t < \lambda$ | $\frac{1}{\lambda}$ | $\frac{1}{\lambda^{2}}$ |
| Normal $N(\mu, \sigma^{2})$ | $e^{\mu t + \sigma^{2}t^{2}/2}$ | $\mu$ | $\sigma^{2}$ |
Worked examples
Worked example: A discrete MGF
- This $X$ is $-1$, 0 or 2 with probabilities $\frac{1}{4}, \frac{1}{2}, \frac{1}{4}$.
- $M'(t) = -\frac{1}{4}e^{-t} + \frac{1}{2}e^{2t}$, so $E[X] = -\frac{1}{4} + \frac{1}{2} = \frac{1}{4}$.
- $M''(t) = \frac{1}{4}e^{-t} + e^{2t}$, so $E[X^{2}] = \frac{5}{4}$ and $\operatorname{Var}(X) = \frac{5}{4} - \frac{1}{16} = \frac{19}{16}$.
Answer: $\frac{1}{4}$ and $\frac{19}{16}$
Worked example: The Poisson
- $M'(t) = \lambda e^{t}M(t)$, so $M'(0) = \lambda$.
- $M''(t) = \lambda e^{t}M(t) + \lambda e^{t}M'(t)$, so $M''(0) = \lambda + \lambda^{2}$.
- $\operatorname{Var}(X) = \lambda + \lambda^{2} - \lambda^{2} = \lambda$.
Answer: Both are $\lambda$.
Worked example: Recognizing a sum
- $$M_{X + Y}(t) = e^{2(e^{t} - 1)}e^{3(e^{t} - 1)} = e^{5(e^{t} - 1)}$$
- That is the Poisson MGF with $\lambda = 5$, and an MGF determines the distribution.
Answer: Poisson with mean 5, matching the convolution lesson with far less work.
Common mistake