Home page for accesible maths 6 Expectation (II)

Style control - access keys in brackets

Font (2 3) - + Letter spacing (4 5) - + Word spacing (6 7) - + Line spacing (8 9) - +

6.4 Moment generating functions

The moment generating function or mgf of a random variable X is defined through

MX(t)=𝖤[etX]={ietipX(i)if X is discrete rv with pmf pX(x)setsfX(s)dsif X is continuous rv with pdf fX(s)

for all real values of t for which the expectation exists.

Moment generating functions can be manipulated in many ways to reveal properties of the underlying probability distributions. They often help in mathematical proofs of probability theorems, and will be used for this purpose in Chapter 9.

Example 6.4.1.

Find the mgf of the random variable following the exponential distribution with parameter β; sketch the mgf when β=4.

Solution.  X𝖤𝗑𝗉(λ)fX(x)=βe-βx, for x>0. Hence,

MX(t) =0etxβe-βxdx=λ0e-x(β-t)dx
=ββ-t

for β>t. Note that MX(t) is only defined for β>t, since only in that case does the integral exist. Hence, for β=4 the mgf looks like:

Unnumbered Figure: Link

Quiz: Now consider a general rv: can the mgf be negative? No; it is the expectation of a non-negative quantity.

Theorem 6.4.1.

If mgf is defined in some neighbourhood of the origin, |t|<t0, the following properties are satisfied:

  1. 1.

    The mgf determines uniquely the distribution of the rv X. That is, if two rvs have the same mgf then they have the same cdf.

  2. 2.

    If Z=a+bX, for a real and b non-zero real number, MZ(t)=eatMX(bt).

  3. 3.

    Moments about the origin can be obtained by differentiating the mgf with respect to t and then evaluating the mgf at zero, i.e.

    MX(0)=𝖤[X0]=1;M(0)=𝖤[X];M′′(0)=𝖤[X2]

    Hence the name!

  4. 4.

    Let X,Y be independent rvs with mgf MX(t),MY(t) respectively. Then,

    MX+Y(t)=MX(t)MY(t).
Proof.
  1. 1.

    Proof uses ideas from complex analysis (see Math215).

  2. 2.

    If Z=a+bX, then

    MZ(t)=Ma+bX(t)=𝖤[e(a+bX)t]=eat𝖤[ebXt]=eatMX(bt).
  3. 3.

    Since M=𝖤[etX] then M(t)=𝖤[XetX], M′′(t)=𝖤[X2etX] etc.; but e0X=1 so

    1. MX(0)=1,

    2. MX(0)=E(X),

    3. MX′′(0)=E(X2),

    and so on.

  4. 4.
    MX+Y(t) =𝖤[e(X+Y)t]
    =𝖤[eXteYt]
    =𝖤[eXt]𝖤[eYt]

by independence, so MX+Y(t)=MX(t)MY(t). ∎

From Part 4, by induction, if X1,X2,,Xn are independent random variables:

MX1+X2++Xn(t)=MX1(t)MX2(t)MXn(t).
Example 6.4.2.

Using its mgf, find the expectation and the variance of the random variable following the exponential distribution with parameter λ.

Solution.  Consider the first two derivatives of the mgf:

M(t)=β(β-t)2, M′′(t)=2β(β-t)3.

Hence, 𝖤[X]=M(0)=1β, 𝖤[X2]=M′′(0)=2β2 and

𝖵𝖺𝗋[X]=𝖤[X2]-𝖤[X]2=1β2.

The mgf of a Normal random variable We first consider ZN(0,1). Then

MZ(t) =𝖤[eZt]=-ezt12πe-z22dz
=12π-e-z2-2zt2dz
=et2/212π-e-(z-t)22dz

by completing the squares. Hence MZ(t)=et2/2 by unit integrability of the N(t,1) density.

So if V=μ+σZ then by Property 2,

Mv(t)=etμMZ(tσ)=eμt+12σ2t2.

For instance, if ZN(0,1) then

  1. MZ(t)=et2/2,

  2. MZ(t)=tet2/2,

  3. MZ′′(t)=t2et2/2+et2/2,

  4. MZ′′′(t)=t3et2/2+3tet2/2,

  5. MZiv(t)=t4et2/2+6t2et2/2+3et2/2.

In particular MZ′′(0)=1,MZiv(0)=3 so 𝖤[Z2]=1 and 𝖤[Z4]=3 as mentioned in Chapter 3.

Unfortunately the mgf is not defined for some rvs.

Example 6.4.3.

Let X𝖢𝖺𝗎𝖼𝗁𝗒, then

Mx(t)=-etxπ(1+x2)dx,

which is not defined as, if t>0 the integrand as x and if t<0 the integrand as x-.