Wize Business Analytics Textbook > Random Variables

Moments and Moment Generating Functions

Reading Moments Out of a Moment Generating Function

A moment of a random variable is one number summarising one feature of its distribution. The nnth raw moment is E[Xn]E[X^n]; the nnth central moment is E[(X−μ)n]E\big[(X-\mu)^n\big], measured about the mean.


The first raw moment is the mean itself, the second central moment is the variance, and the third and fourth describe skewness and tail weight.


Computing these one at a time from a density or a mass function means a new integral or a new sum for every order.

One function that stores every moment

The moment generating function of XX is


MX(t)=E ⁣[etX],M_X(t)=E\!\left[e^{tX}\right],


defined for those tt where the expectation is finite. Expanding etXe^{tX} as a power series and taking expectations term by term gives


MX(t)=1+tE[X]+t22!E[X2]+t33!E[X3]+⋯ ,M_X(t)=1+tE[X]+\frac{t^{2}}{2!}E[X^{2}]+\frac{t^{3}}{3!}E[X^{3}]+\cdots,


so the moments are stored as the Taylor coefficients. There are two equivalent ways to get one out. Differentiate nn times and set t=0t=0, which gives MX(n)(0)=E[Xn]M_X^{(n)}(0)=E[X^{n}]; or, if you already have the series, read off the coefficient of tnt^{n} and multiply it by n!n!. The variance then follows from the first two raw moments, Var⁡(X)=MX′′(0)−[MX′(0)]2\operatorname{Var}(X)=M_X''(0)-\big[M_X'(0)\big]^{2}.

How the Taylor expansion of a moment generating function about the origin stores the raw moments of X, and the two equivalent ways of reading one out.

How the Taylor expansion of a moment generating function about the origin stores the raw moments of X, and the two equivalent ways of reading one out.

Worked example

Let XX be 1 if a randomly chosen bus is late and 0 otherwise, with P(X=1)=0.4P(X=1)=0.4. Then MX(t)=0.6e0⋅t+0.4e1⋅t=0.6+0.4etM_X(t)=0.6e^{0\cdot t}+0.4e^{1\cdot t}=0.6+0.4e^{t}. Differentiating, MX′(t)=0.4etM_X'(t)=0.4e^{t}, so MX′(0)=0.4=E[X]M_X'(0)=0.4=E[X]. Differentiating again gives MX′′(t)=0.4etM_X''(t)=0.4e^{t} and MX′′(0)=0.4=E[X2]M_X''(0)=0.4=E[X^{2}], which is no surprise because X2=XX^{2}=X for a zero-one variable. The variance is 0.4−(0.4)2=0.240.4-(0.4)^{2}=0.24. Every moment came from one function and some differentiation, with no sums to redo.

Existence and validity checks

Two quick tests catch most errors. First, MX(0)=E[e0]=1M_X(0)=E[e^{0}]=1 for every random variable, so a candidate function with M(0)≠1M(0)\ne 1 is not an MGF.


Second, the definition only helps if the expectation is finite on an open interval containing 00; for the exponential family of waiting times, for instance, MX(t)M_X(t) exists only for tt below the rate, and outside that range the integral diverges.


Some distributions, such as the Cauchy, have no MGF at all, which is why probabilists fall back on the characteristic function E[eitX]E[e^{itX}]. The characteristic function always exists and still characterizes the distribution.


When the relevant moments exist, its derivatives at zero can also recover them: if E∣X∣nE|X|^n is finite, then φ(n)(0)=inE[Xn]\varphi^{(n)}(0)=i^n E[X^n]. Unlike an MGF, however, its existence alone does not guarantee that any moments exist; the Cauchy characteristic function e−∣t∣e^{-|t|} is not even differentiable at zero.

Moment generating function of a bus waiting time

Moment generating function of a bus waiting time



For any random variable XX whose moment generating function MX(t)=E[etX]M_X(t)=E[e^{tX}] exists near t=0t=0, what is the value of MX(0)M_X(0)?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

The figure shows how the Taylor expansion of MX(t)M_X(t) about t=0t=0 stores the raw moments of XX. A random variable XX has a moment generating function whose expansion about t=0t=0 begins

MX(t)=1+3t+7t2+15t3+⋯M_X(t)=1+3t+7t^{2}+15t^{3}+\cdots

What is E[X2]E[X^{2}]?

How the Taylor expansion of a moment generating function about the origin stores the raw moments of X, and the two equivalent ways of reading one out.

How the Taylor expansion of a moment generating function about the origin stores the raw moments of X, and the two equivalent ways of reading one out.

Moment generating function of a bus waiting time

Moment generating function of a bus waiting time

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

The graph shows the moment generating function of a bus waiting time XX, in minutes, which is modelled as exponential with an unknown rate λ\lambda, so that MX(t)=λλ−tM_X(t)=\dfrac{\lambda}{\lambda-t} for t<λt<\lambda. The plotted curve passes through the point (2, 2)(2,\,2). What is E[X]E[X]?

How the Taylor expansion of a moment generating function about the origin stores the raw moments of X, and the two equivalent ways of reading one out.

How the Taylor expansion of a moment generating function about the origin stores the raw moments of X, and the two equivalent ways of reading one out.

Moment generating function of a bus waiting time

Moment generating function of a bus waiting time

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors