What Is Moment Generating Function?
The moment generating function of a random variable X is M(t) = E[e^(tX)]. Differentiating it at t = 0 gives the moments: M′(0) is the mean and M″(0) is E[X²].
Pick a distribution, enter its parameters and a value of t. The calculator returns M(t), the closed-form formula, the mean, the variance and a plot of M(t).
The exponential MGF exists only for t below the rate, so the calculator checks the domain before it evaluates.
How to Use the Moment Generating Function Calculator
- Pick the distribution.
- Enter its parameters.
- Enter t.
- Read M(t), the mean and the variance.
Moment Generating Function Formula
Definition
Binomial
Poisson
Normal
Exponential
Moment Generating Function Variables Explained
| Symbol | Meaning | Notes |
|---|---|---|
| M(t) | Moment generating function | |
| t | Real argument | |
| M′(0) | Mean E[X] | |
| M″(0) | E[X²] |
Moment Generating Function Worked Example
For a binomial with n = 10 and p = 0.3, M(t) = (0.7 + 0.3eᵗ)¹⁰. At t = 0.5, eᵗ = 1.6487, so M = (0.7 + 0.4946)¹⁰ = 1.1946¹⁰ ≈ 5.92. The mean is np = 3 and the variance is np(1 − p) = 2.1.
With the example values loaded in the calculator above, the steps are:
- Distribution parameters: n = 10, p = 0.3.
- M(t) = (1 − p + p·eᵗ)ⁿ.
- Evaluate at t = 0.5: M = 5.919495.
- The first derivative at 0 gives the mean (3; a numeric check of M′(0) gives 3). The second derivative at 0 minus the mean squared gives the variance (2.1).
Result: M(0.5) = 5.919495.
How to Read an MGF Result
M(t) = E[e^(tX)] summarises every moment of a distribution in one function. For a binomial with n = 10 and p = 0.3, M(0.5) = (0.7 + 0.3e^0.5)¹⁰ ≈ 5.92. The value itself is rarely the goal. The derivatives at t = 0 are what matter: M′(0) is the mean 3 and M″(0) − M′(0)² is the variance 2.1.
The chart shows M(t) rising through M(0) = 1. If an MGF exists on an interval around 0, it identifies the distribution uniquely, which is why MGFs are used to prove results about sums of independent variables.
Where Moment Generating Function Is Used
Checking textbook formulas
Compare M(t) for binomial, Poisson, normal, exponential and uniform distributions.
Mean and variance
Confirm E[X] and Var(X) from the derivatives at 0.
Sums of variables
Multiply MGFs to get the MGF of a sum of independent variables.
Exam practice
Check evaluations of M(t) at a chosen t.
Common Moment Generating Function Mistakes to Avoid
- M(0) is always 1. Use it as a quick check.
- The exponential MGF exists only for t below the rate λ. The calculator rejects other values.
- Differentiate once for the mean, and twice for E[X²]. The variance then needs the mean squared subtracted.
- The MGF of a sum of independent variables is the product of their MGFs.
Moment Generating Function Terms and Definitions
- Moment
- E[Xᵏ], the expected value of the k-th power of X.
Moment Generating Function FAQs
What is a moment generating function?
It is M(t) = E[e^(tX)], viewed as a function of t. Its derivatives at t = 0 give the moments of the distribution.
How do you find the mean from the MGF?
Differentiate M(t) once and set t = 0. The result M′(0) is E[X].
How do you find the variance from the MGF?
Compute M″(0) − (M′(0))². The first term is E[X²].
Does every distribution have an MGF?
No. The Cauchy distribution has none, and some heavy-tailed distributions have an MGF only at t = 0.