Moment Generating Function (MGF) Calculator: Common Distributions

Moment Generating Function Calculator

Moment Generating Function Calculator

Visualize and compute the MGF $M_X(t) = E[e^{tX}]$ for standard probability distributions.

Distribution

MGF Formula

$$ M_X(t) = \frac{\lambda}{\lambda – t}, \quad t < \lambda $$
Mean E[X] = M'(0)
Variance Var(X)

MGF Plot $M_X(t)$ vs $t$

Curve Asymptote
Note: MGF is always 1 at t=0.

Understanding Moment Generating Functions

The Moment Generating Function (MGF) of a random variable $X$ is defined as the expected value of the exponential function $e^{tX}$: $$ M_X(t) = E[e^{tX}] $$ provided this expectation exists for $t$ in some neighborhood of 0.

Why is it useful?

  • Generating Moments: As the name suggests, it generates moments (mean, variance, etc.). The $n$-th moment is the $n$-th derivative evaluated at $t=0$: $$ E[X^n] = M_X^{(n)}(0) $$
  • Uniqueness: If two random variables have the same MGF, they have the same probability distribution. This is crucial for proving the Central Limit Theorem.
  • Sum of Independent Variables: If $X$ and $Y$ are independent, the MGF of their sum is the product of their MGFs: $M_{X+Y}(t) = M_X(t)M_Y(t)$.

Existence

The MGF does not always exist (e.g., Cauchy distribution). For distributions with “heavy tails,” the integral may diverge for any $t > 0$. In such cases, the Characteristic Function (using imaginary numbers) is used instead.

FAQ

Why is M(0) always 1?
By definition, $M_X(0) = E[e^{0 \cdot X}] = E[e^0] = E[1] = 1$. This is a good sanity check for any MGF calculation.
How do I calculate Variance from MGF?
Variance is defined as $Var(X) = E[X^2] – (E[X])^2$. Using the MGF, this translates to: $$ Var(X) = M”(0) – [M'(0)]^2 $$
What is the asymptote in Exponential MGF?
For an Exponential distribution with rate $\lambda$, the MGF is $\frac{\lambda}{\lambda – t}$. The denominator becomes zero when $t = \lambda$, creating a vertical asymptote. The MGF is only defined for $t < \lambda$.

UNDERGRADUATE