Topic 5 of 7
Moment generating functions
Step 22 · Probability theory topics
Pack a distribution into its moment generating function, read off the mean and variance by differentiating, and use these functions to find distributions of sums.
Defining the moment generating function
The moment generating function, or MGF, of X is . It packs every moment E(Xⁿ) into one function, and two distributions with the same MGF are the same distribution.
Example: A coin
X is 1 with probability p and 0 otherwise. Find its MGF.
- .
Answer
Example: An exponential
X has density for x ≥ 0. Find its MGF.
- , for t < λ.
Answer
| Distribution | MGF |
|---|---|
| Binomial(n, p) | |
| Poisson(λ) | |
| Exponential(λ) | |
| Normal(μ, σ²) |
Moments from the MGF
The nth derivative of M at t = 0 is the nth moment, E(Xⁿ). So the mean is M′(0), and the variance is M″(0) − M′(0)².
Example: Exponential moments
Use to find E(X) and Var(X).
- , so E(X) = 1/λ.
- , so E(X²) = 2/λ².
- Var(X) = 2/λ² − 1/λ².
AnswerMean , variance
Example: A Poisson mean
Use to find the mean.
- , and M(0) = 1.
Answerλ
Sums of independent variables
If X and Y are independent, the MGF of X + Y is the product of their MGFs. Multiplying MGFs is far easier than working out the distribution of a sum directly.
Example: Binomial from coins
Add n independent coin flips, each 1 with probability p.
- Each has MGF .
- The sum has MGF : binomial(n, p).
AnswerA binomial(n, p) count
Example: Poisson sums
X is Poisson(2) and Y is Poisson(3), and they are independent. What is the distribution of X + Y?
- .
AnswerPoisson(5)
Try it yourself
Work each one on paper first, then open the answer to check.
What is M(0) for any random variable?
Show answer
1
What distribution has MGF ?
Show answer
Binomial with n = 10 and p = 0.5
What are the mean and variance of a variable with MGF ?
Show answer
Mean 2, variance 16
M′(0) = 3 and M″(0) = 13. What is Var(X)?
Show answer
4
X and Y are independent with MGFs M₁ and M₂. What is the MGF of X + Y?
Show answer
M₁(t) M₂(t)
X is Poisson(1) and Y is Poisson(4), and they are independent. What is X + Y?
Show answer
Poisson(5)