St · Statistics & Probability

What Is the Moment-Generating Function of an Exponential Distribution?

Published By the 9to5Science editorial team

At a glance

  1. 1. Choose a parameterization

    Write the exponential density using its rate λ, or convert from scale θ before substituting.

  2. 2. Evaluate the expectation

    Integrate e to the power tx against the density over all nonnegative x.

  3. 3. Check the domain

    The integral converges only for t less than the rate, which includes a neighborhood of zero.

  4. 4. Differentiate for moments

    Use derivatives of the MGF at zero to obtain the mean, variance, and higher moments.

Let XX have an exponential distribution with rate λ>0\lambda>0, so its density is fX(x)=λe−λxf_X(x)=\lambda e^{-\lambda x} for x≥0x\ge 0. Its moment-generating function (MGF) is

MX(t)=λλ−t,t<λ.M_X(t)=\frac{\lambda}{\lambda-t},\qquad t<\lambda.

The condition on tt matters: the defining expectation is finite for every t<λt<\lambda, including negative values, and diverges for t≥λt\ge\lambda. In particular, it is finite on an interval around zero, as required for the usual use of an MGF.

Deriving the MGF

By definition, MX(t)=E[etX]M_X(t)=\mathbb{E}[e^{tX}]. Integrate against the exponential density:

MX(t)=∫0∞etxλe−λx dx=λ∫0∞e−(λ−t)x dx.\begin{aligned} M_X(t) &=\int_0^\infty e^{tx}\lambda e^{-\lambda x}\,dx\\ &=\lambda\int_0^\infty e^{-(\lambda-t)x}\,dx. \end{aligned}

This improper integral converges when λ−t>0\lambda-t>0. Under that condition, its value is 1/(λ−t)1/(\lambda-t), so

MX(t)=λλ−t.M_X(t)=\frac{\lambda}{\lambda-t}.

If t=λt=\lambda, the integrand in the last integral is the constant λ\lambda, so the integral diverges. If t>λt>\lambda, the integrand grows exponentially and the integral also diverges. Thus the formula is not a finite MGF at or above t=λt=\lambda.

Rate and scale forms

Some books parameterize an exponential distribution by its scale θ=1/λ\theta=1/\lambda instead of its rate. The density is then fX(x)=1θe−x/θf_X(x)=\frac{1}{\theta}e^{-x/\theta}, and the MGF can be written as

MX(t)=11−θt,t<1θ.M_X(t)=\frac{1}{1-\theta t},\qquad t<\frac{1}{\theta}.

These are the same formula in different parameters. Check which convention is being used before substituting a number: the rate is the reciprocal of the mean, while the scale is the mean itself.

Using the MGF to find moments

The nnth raw moment is the nnth derivative of the MGF evaluated at zero, provided the MGF exists around zero. For the rate form,

MX′(t)=λ(λ−t)2,MX′′(t)=2λ(λ−t)3.M_X'(t)=\frac{\lambda}{(\lambda-t)^2},\qquad M_X''(t)=\frac{2\lambda}{(\lambda-t)^3}.

Therefore,

E[X]=MX′(0)=1λ,E[X2]=MX′′(0)=2λ2.\mathbb{E}[X]=M_X'(0)=\frac{1}{\lambda},\qquad \mathbb{E}[X^2]=M_X''(0)=\frac{2}{\lambda^2}.

Since Var⁡(X)=E[X2]−(E[X])2\operatorname{Var}(X)=\mathbb{E}[X^2]-(\mathbb{E}[X])^2, the variance is 1/λ21/\lambda^2. More generally, differentiating repeatedly gives

E[Xn]=n!λn\mathbb{E}[X^n]=\frac{n!}{\lambda^n}

for nonnegative integers nn.

Worked example: rate 2

Suppose X∼Exponential⁡(2)X\sim\operatorname{Exponential}(2), using the rate convention. Then

MX(t)=22−t,t<2.M_X(t)=\frac{2}{2-t},\qquad t<2.

The first two derivatives are MX′(t)=2/(2−t)2M_X'(t)=2/(2-t)^2 and MX′′(t)=4/(2−t)3M_X''(t)=4/(2-t)^3. Evaluating at zero gives

E[X]=222=12,E[X2]=423=12.\mathbb{E}[X]=\frac{2}{2^2}=\frac12, \qquad \mathbb{E}[X^2]=\frac{4}{2^3}=\frac12.

So Var⁡(X)=12−(12)2=14\operatorname{Var}(X)=\frac12-(\frac12)^2=\frac14. These values also match the rate-based formulas 1/λ1/\lambda and 1/λ21/\lambda^2.

MGF of a sum of independent exponentials

If X1,…,XnX_1,\ldots,X_n are independent, the MGF of their sum is the product of their MGFs:

MX1+⋯+Xn(t)=∏i=1nMXi(t).M_{X_1+\cdots+X_n}(t)=\prod_{i=1}^n M_{X_i}(t).

For example, if two independent variables both have rate λ\lambda, then

MX1+X2(t)=(λλ−t)2,t<λ.M_{X_1+X_2}(t)=\left(\frac{\lambda}{\lambda-t}\right)^2,\qquad t<\lambda.

This is the MGF of a gamma distribution with shape 22 and rate λ\lambda. The restriction t<λt<\lambda is shared by the product because both individual MGFs must be finite.

Common mistakes

  • Dropping the domain: λ/(λ−t)\lambda/(\lambda-t) is valid as an MGF only for t<λt<\lambda. At t=λt=\lambda the defining integral diverges.
  • Mixing up rate and scale: With rate λ\lambda, the mean is 1/λ1/\lambda. With scale θ\theta, the mean is θ\theta.
  • Using the MGF formula outside its domain: The algebraic expression may still produce a number for some tt, but that does not make it the expectation E[etX]\mathbb{E}[e^{tX}] when the integral diverges.
  • Confusing raw and central moments: MX′′(0)M_X''(0) gives E[X2]\mathbb{E}[X^2], not the variance directly. Subtract the square of the mean to obtain the variance.

References

  1. Sheldon Ross, A First Course in Probability
  2. George Casella and Roger L. Berger, Statistical Inference

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.