1. Home
  2. Explore
  3. Mathematics
  4. Moment Generating Functions

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Moment Generating Functions

Moment Generating Functions

The Importance of Moments in Probability

Moments of a probability distribution are the expected values of powers of a random variable. Formally, the nnn-th moment of a random variable XXX is defined as E[Xn]E[X^n]E[Xn]. There are infinitely many moments, and they serve as unique identifiers of a probability distribution—analogous to how the Taylor series coefficients uniquely determine an analytic function.

  • First moment: E[X]E[X]E[X] — the mean of the distribution.

  • Second moment: E[X2]E[X^2]E[X2] — closely related to the variance: Var(X)=E[X2]−(E[X])2\text{Var}(X) = E[X^2] - (E[X])^2Var(X)=E[X2]−(E[X])2.

  • Third moment: E[X3]E[X^3]E[X3] — measures skewness (asymmetry) of the distribution. For example, the Poisson distribution has nonzero skew.

  • Fourth moment: E[X4]E[X^4]E[X4] — measures kurtosis (tail heaviness). Distributions with “fat tails” have high kurtosis.

For some distributions (e.g., the normal distribution) the first two moments completely characterize the distribution. For many others, higher-order moments are needed. Just as the derivatives at a point describe a function via its Taylor series, the moments (if they exist) uniquely determine the cumulative distribution function (CDF) of a random variable.

Key Idea: Moments are the “fingerprint” of a probability distribution. The moment generating function is a tool that efficiently extracts all moments from a single function.


Definition of the Moment Generating Function (MGF)

The moment generating function of a random variable XXX is defined using a new variable ttt (or sss) and is constructed as the expected value of etXe^{tX}etX.

For Discrete Random Variables

If XXX is discrete with probability mass function p(x)=P(X=x)p(x) = P(X = x)p(x)=P(X=x), then

MX(t)=E[etX]=∑xetx p(x).M_X(t) = \mathbb{E}[e^{tX}] = \sum_{x} e^{tx} \, p(x).MX​(t)=E[etX]=∑x​etxp(x).

For Continuous Random Variables

If XXX is continuous with probability density function f(x)f(x)f(x), then

MX(t)=E[etX]=∫−∞∞etx f(x) dx.M_X(t) = \mathbb{E}[e^{tX}] = \int_{-\infty}^{\infty} e^{tx} \, f(x) \, dx.MX​(t)=E[etX]=∫−∞∞​etxf(x)dx.

This integral is precisely the Laplace transform of the PDF f(x)f(x)f(x). This deep connection links probability theory to differential equations and transforms, and is historically tied to Pierre-Simon Laplace’s foundational work in probability and statistics.


Key Property: Derivatives Generate Moments

The moment generating function is named for its most useful property:

Theorem: The nnn-th derivative of the MGF evaluated at t=0t=0t=0 equals the nnn-th moment of XXX:

MX(n)(0)=E[Xn].M_X^{(n)}(0) = \mathbb{E}[X^n].MX(n)​(0)=E[Xn].

Thus:

  • First derivative at 0: MX′(0)=E[X]M_X'(0) = E[X]MX′​(0)=E[X] (mean).

  • Second derivative at 0: MX′′(0)=E[X2]M_X''(0) = E[X^2]MX′′​(0)=E[X2] (needed for variance).

  • Third derivative at 0: MX′′′(0)=E[X3]M_X'''(0) = E[X^3]MX′′′​(0)=E[X3] (related to skewness).

  • Fourth derivative at 0: MX(4)(0)=E[X4]M_X^{(4)}(0) = E[X^4]MX(4)​(0)=E[X4] (related to kurtosis).

This property makes computing moments much easier than direct integration or summation, especially for higher-order moments.

Uniqueness

If the MGF exists in a neighborhood of t=0t=0t=0, it uniquely determines the probability distribution. More precisely, the MGF uniquely determines the cumulative distribution function F(x)=P(X≤x)F(x) = P(X \le x)F(x)=P(X≤x). This is why the MGF is a powerful tool for proving limit theorems like the Central Limit Theorem.


Examples of Computing Moment Generating Functions

Example 1: Poisson Distribution

Let X∼Poisson(λ)X \sim \text{Poisson}(\lambda)X∼Poisson(λ) with probability mass function

P(X=k)=λke−λk!,k=0,1,2,…P(X = k) = \frac{\lambda^k e^{-\lambda}}{k!}, \quad k = 0,1,2,\dotsP(X=k)=k!λke−λ​,k=0,1,2,…

The MGF is

MX(t)=∑k=0∞etkλke−λk!=e−λ∑k=0∞(etλ)kk!.M_X(t) = \sum_{k=0}^{\infty} e^{tk} \frac{\lambda^k e^{-\lambda}}{k!} = e^{-\lambda} \sum_{k=0}^{\infty} \frac{(e^{t} \lambda)^k}{k!}.MX​(t)=∑k=0∞​etkk!λke−λ​=e−λ∑k=0∞​k!(etλ)k​.

The sum is the Taylor series for eetλe^{e^{t}\lambda}eetλ, so

MX(t)=e−λ eλet=eλ(et−1).M_X(t) = e^{-\lambda} \, e^{\lambda e^{t}} = e^{\lambda (e^{t} - 1)}.MX​(t)=e−λeλet=eλ(et−1).

This compact function can be differentiated to obtain the mean (E[X]=λE[X]=\lambdaE[X]=λ), variance (Var(X)=λ\text{Var}(X)=\lambdaVar(X)=λ), and higher moments.

Example 2: Standard Normal Distribution

Let X∼N(0,1)X \sim N(0,1)X∼N(0,1) with PDF f(x)=12πe−x2/2f(x) = \frac{1}{\sqrt{2\pi}} e^{-x^2/2}f(x)=2π​1​e−x2/2. Then

MX(t)=∫−∞∞etx12πe−x2/2 dx=12π∫−∞∞e−(x2/2−tx) dx.M_X(t) = \int_{-\infty}^{\infty} e^{tx} \frac{1}{\sqrt{2\pi}} e^{-x^2/2} \, dx = \frac{1}{\sqrt{2\pi}} \int_{-\infty}^{\infty} e^{-(x^2/2 - tx)} \, dx.MX​(t)=∫−∞∞​etx2π​1​e−x2/2dx=2π​1​∫−∞∞​e−(x2/2−tx)dx.

Complete the square in the exponent:

x2/2−tx=12(x−t)2−t22.x^2/2 - tx = \frac{1}{2}(x - t)^2 - \frac{t^2}{2}.x2/2−tx=21​(x−t)2−2t2​.

Thus

MX(t)=et2/2⋅12π∫−∞∞e−12(x−t)2 dx.M_X(t) = e^{t^2/2} \cdot \frac{1}{\sqrt{2\pi}} \int_{-\infty}^{\infty} e^{-\frac{1}{2}(x-t)^2} \, dx.MX​(t)=et2/2⋅2π​1​∫−∞∞​e−21​(x−t)2dx.

The integrand is a normal PDF with mean ttt and variance 111, so its integral is 111. Therefore

MX(t)=et2/2.M_X(t) = e^{t^2/2}.MX​(t)=et2/2.

This simple exponential form is crucial for deriving the Central Limit Theorem.

Example 3: Exponential Distribution

Let X∼Exponential(λ)X \sim \text{Exponential}(\lambda)X∼Exponential(λ) with PDF f(t)=λe−λtf(t) = \lambda e^{-\lambda t}f(t)=λe−λt for t≥0t \ge 0t≥0. Use a dummy variable sss (since ttt often denotes time) for the transform:

MX(s)=∫0∞est λe−λt dt=λ∫0∞e(s−λ)t dt.M_X(s) = \int_{0}^{\infty} e^{st} \, \lambda e^{-\lambda t} \, dt = \lambda \int_{0}^{\infty} e^{(s-\lambda)t} \, dt.MX​(s)=∫0∞​estλe−λtdt=λ∫0∞​e(s−λ)tdt.

This integral converges only for s<λs < \lambdas<λ (assuming real sss). Evaluating:

MX(s)=λ[e(s−λ)ts−λ]0∞=λλ−s,s<λ.M_X(s) = \lambda \left[ \frac{e^{(s-\lambda)t}}{s-\lambda} \right]_{0}^{\infty} = \frac{\lambda}{\lambda - s}, \quad s < \lambda.MX​(s)=λ[s−λe(s−λ)t​]0∞​=λ−sλ​,s<λ.

The MGF for the exponential distribution is a rational function. From it, the moments can be derived: E[X]=1/λE[X] = 1/\lambdaE[X]=1/λ, Var(X)=1/λ2\text{Var}(X) = 1/\lambda^2Var(X)=1/λ2, etc.


Why the MGF Matters: The Central Limit Theorem

One of the most important uses of the MGF is in proving the Central Limit Theorem (CLT). The CLT states that the sum of many independent and identically distributed random variables (with finite variance) converges in distribution to a normal distribution. The proof works by showing that the MGF of the standardized sum converges to the MGF of a standard normal (et2/2e^{t^2/2}et2/2). Because the MGF uniquely determines the distribution, the convergence of MGFs implies convergence of distributions.

Understanding MGFs therefore builds a bridge to advanced probability theory and to many applications in statistics, engineering, and the sciences.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent