Tutorials › Statistical Theory I - Probability and Distribution Theory › Exponential and Gamma Moments from MGFs

Moments and Generating Functions · Tutorial 510 of 994

Exponential and Gamma Moments from MGFs

Learn how the rate and scale forms of the gamma MGF yield raw and central moments, and how the exponential distribution follows as a special case.

Intermediate 10 min read

What You'll Learn

  • Write the exponential and gamma MGFs under rate and scale conventions, including their domains.
  • Derive gamma raw moments by differentiating its MGF.
  • Obtain exponential raw moments as a special case of the gamma formula.
  • Calculate gamma central moments from the centered MGF.
  • Check parameterization and raw-versus-central moment calculations in worked examples.

From Distribution Form to Moments

The exponential and gamma distributions are useful models for positive quantities such as waiting times and accumulated event times. Their densities look different, but their moment-generating functions have a compact form that makes repeated differentiation systematic. The main care required is to keep the rate and scale parameterizations distinct: they are reciprocals, and confusing them changes both the MGF and the resulting moments.

We use \(M_X(t)=E[e^{tX}]\) for the moment-generating function (MGF), wherever this expectation is finite on an open interval containing zero. When such an interval exists, its derivatives at zero give raw moments: \(M_X^{(r)}(0)=E[X^r]\) for nonnegative integers \(r\). The earlier material on MGF domains and differentiation establishes the conditions for this rule; here we apply it to these two distribution families.

MGFs Under Rate and Scale Conventions

Definition: An exponential random variable with rate \(\lambda>0\), written \(X\sim\operatorname{Exponential}(\lambda)\), has density \(f(x)=\lambda e^{-\lambda x}\) for \(x\geq 0\), and zero otherwise. A gamma random variable with shape \(\alpha>0\) and rate \(\lambda>0\), written \(X\sim\operatorname{Gamma}(\alpha,\lambda)\) in the rate convention, has density \(f(x)=\frac{\lambda^\alpha}{\Gamma(\alpha)}x^{\alpha-1}e^{-\lambda x}\) for \(x>0\). Here \(\Gamma(\alpha)=\int_0^\infty u^{\alpha-1}e^{-u}\,du\).

In the scale convention, the gamma density instead uses a scale \(\theta>0\): \(f(x)=x^{\alpha-1}e^{-x/\theta}/(\Gamma(\alpha)\theta^\alpha)\). These describe the same family when \(\theta=1/\lambda\). Some texts write \(\operatorname{Gamma}(\alpha,\theta)\) for this scale form; always check which second parameter is intended.

Theorem: If \(X\sim\operatorname{Gamma}(\alpha,\lambda)\) in the rate convention, then \(M_X(t)=(\lambda/(\lambda-t))^\alpha\) for \(t<\lambda\). In the scale convention, \(M_X(t)=(1-\theta t)^{-\alpha}\) for \(t<1/\theta\). The exponential distribution is the gamma distribution with shape \(\alpha=1\); its rate-form MGF is \(M_X(t)=\lambda/(\lambda-t)\), for \(t<\lambda\).

To obtain the rate-form MGF, combine the density and the factor \(e^{tx}\). If \(t<\lambda\), the resulting integral converges, and the change of variable \(u=(\lambda-t)x\) gives

$$ M_X(t)=\frac{\lambda^\alpha}{\Gamma(\alpha)} \int_0^\infty x^{\alpha-1}e^{-(\lambda-t)x}\,dx =\frac{\lambda^\alpha}{(\lambda-t)^\alpha}. $$

The last equality follows from the defining gamma integral after the change of variable. If \(t\geq\lambda\), the integrand does not have an exponentially decreasing tail, and the expectation is infinite. Substituting \(\lambda=1/\theta\) gives the scale form and its domain. Setting \(\alpha=1\), with \(\Gamma(1)=1\), gives the exponential result.

Raw Moments by Differentiation

For compact notation, define the rising factorial \((\alpha)^{\overline r}=\alpha(\alpha+1)\cdots(\alpha+r-1)\) for integer \(r\geq1\), and \((\alpha)^{\overline 0}=1\). The MGF formula yields every raw moment in one expression.

Theorem: If \(X\sim\operatorname{Gamma}(\alpha,\lambda)\) with shape \(\alpha>0\) and rate \(\lambda>0\), then for each integer \(r\geq0\), \(E[X^r]=(\alpha)^{\overline r}/\lambda^r\). In the scale convention, this is \(E[X^r]=(\alpha)^{\overline r}\theta^r\). For an exponential variable, \(E[X^r]=r!/\lambda^r\).

Proof. Write \(M_X(t)=\lambda^\alpha(\lambda-t)^{-\alpha}\). Repeated differentiation gives

$$ M_X^{(r)}(t) =(\alpha)^{\overline r}\lambda^\alpha(\lambda-t)^{-(\alpha+r)}. $$

This formula holds for \(r=0\). If it holds for \(r\), differentiating the power \((\lambda-t)^{-(\alpha+r)}\) multiplies it by \(\alpha+r\) and changes its exponent to \(-(\alpha+r+1)\), giving the formula for \(r+1\). Thus it holds for every nonnegative integer \(r\). Since \(0\) lies inside the MGF's open domain \(t<\lambda\), the MGF differentiation rule applies. Evaluating at zero gives \(E[X^r]=M_X^{(r)}(0)=(\alpha)^{\overline r}/\lambda^r\). Replacing \(\lambda\) by \(1/\theta\) gives the scale expression. For \(\alpha=1\), \((1)^{\overline r}=r!\), giving the exponential formula. \(\square\)

Worked Example: Raw Moments of an Exponential Waiting Time

Suppose \(X\sim\operatorname{Exponential}(0.5)\), with rate \(0.5\) per hour. Find its MGF, mean, second raw moment, and variance.

The MGF is \(M_X(t)=0.5/(0.5-t)\), valid for \(t<0.5\). The raw-moment formula with \(\alpha=1\) gives

$$ E[X]=\frac{1!}{0.5}=2\text{ hours},\qquad E[X^2]=\frac{2!}{(0.5)^2}=8\text{ hours}^2. $$

Using \(\operatorname{Var}(X)=E[X^2]-(E[X])^2\), we obtain \(\operatorname{Var}(X)=8-2^2=4\text{ hours}^2\). The units also check: the mean is in hours and the variance is in squared hours.

Worked Example: Raw Moments for a Gamma Variable

Let \(Y\sim\operatorname{Gamma}(3,2)\), where the parameters are shape \(3\) and rate \(2\). Calculate the MGF and the first three raw moments.

The MGF and its domain are \(M_Y(t)=(2/(2-t))^3\), for \(t<2\). The rising factorials needed are \((3)^{\overline1}=3\), \((3)^{\overline2}=3\cdot4=12\), and \((3)^{\overline3}=3\cdot4\cdot5=60\). Therefore

$$ E[Y]=\frac{3}{2},\qquad E[Y^2]=\frac{12}{2^2}=3,\qquad E[Y^3]=\frac{60}{2^3}=\frac{15}{2}. $$

As a check, \(E[Y]\) is positive and \(E[Y^2]\geq(E[Y])^2\), since \(3\geq(3/2)^2=9/4\). The variance is consequently \(3-9/4=3/4\).

Central Moments from the Centered MGF

A central moment is a moment of the centered variable \(X-E[X]\). The centered MGF is \(E[e^{t(X-E[X])}]=e^{-tE[X]}M_X(t)\). For a gamma variable, the mean from the raw-moment formula is \(\alpha/\lambda\). Using the scale-free variable \(z=t/\lambda\), its centered MGF is

$$ E\!\left[e^{t(X-E[X])}\right] =e^{-\alpha z}(1-z)^{-\alpha},\qquad z=t/\lambda,\quad t<\lambda. $$

The logarithmic expansion \(-\log(1-z)=\sum_{j=1}^{\infty}z^j/j\) is valid for \(|z|<1\). Hence the logarithm of this centered MGF is \(\alpha(z^2/2+z^3/3+z^4/4+\cdots)\). Expanding its exponential through the fourth power gives the central moments below.

Theorem: For \(X\sim\operatorname{Gamma}(\alpha,\lambda)\), the variance, third central moment, and fourth central moment are \(\alpha/\lambda^2\), \(2\alpha/\lambda^3\), and \(3\alpha(\alpha+2)/\lambda^4\), respectively. In the scale convention, replace \(\lambda^{-1}\) by \(\theta\).

Derivation. Put \(Z=X-E[X]\). Through order four, the centered MGF, expressed as a power series in \(z=t/\lambda\), is

$$ e^{-\alpha z}(1-z)^{-\alpha} =1+\frac{\alpha}{2}z^2+\frac{\alpha}{3}z^3+ \left(\frac{\alpha}{4}+\frac{\alpha^2}{8}\right)z^4+O(z^5). $$

There is no linear term because \(E[Z]=0\). The coefficient of \(t^r\) in an MGF is \(E[Z^r]/r!\). The coefficient of \(t^2\) is \(\alpha/(2\lambda^2)\), so \(E[Z^2]=2!\alpha/(2\lambda^2)=\alpha/\lambda^2\). The coefficient of \(t^3\) is \(\alpha/(3\lambda^3)\), so \(E[Z^3]=3!\alpha/(3\lambda^3)=2\alpha/\lambda^3\). Finally, the coefficient of \(t^4\) is \((\alpha/4+\alpha^2/8)/\lambda^4\), so

$$ E[Z^4]=4!\left(\frac{\alpha}{4}+\frac{\alpha^2}{8}\right)\frac{1}{\lambda^4} =\frac{6\alpha+3\alpha^2}{\lambda^4} =\frac{3\alpha(\alpha+2)}{\lambda^4}. $$

All these derivatives are valid because the centered MGF is finite on an open interval containing zero. The scale versions follow from \(\lambda=1/\theta\). \(\square\)

Worked Example: Central Moments in the Scale Convention

Let \(W\) have a gamma distribution with shape \(2\) and scale \(3\). Find its MGF, mean, variance, third central moment, and fourth central moment.

Here \(\theta=3\), so \(M_W(t)=(1-3t)^{-2}\), for \(t<1/3\). The mean is \(\alpha\theta=2\cdot3=6\). Applying the central-moment formulas gives

$$ \operatorname{Var}(W)=2\cdot3^2=18,\qquad E[(W-6)^3]=2\cdot2\cdot3^3=108, $$ $$ E[(W-6)^4]=3\cdot2\cdot(2+2)\cdot3^4=1944. $$

The values scale as the corresponding powers of the measurement unit: variance has units squared, the third central moment has units cubed, and the fourth has units to the fourth power. Their signs and sizes are also consistent with the formulas: the variance and fourth central moment are positive, and the third central moment is positive for this right-skewed gamma distribution.

Parameterization and Moment Pitfalls

The formulas are easy to misapply when the second gamma parameter is not identified as a rate or a scale. For shape \(\alpha\), rate \(\lambda\), the mean is \(\alpha/\lambda\); for shape \(\alpha\), scale \(\theta\), it is \(\alpha\theta\). The MGF domains differ in the same reciprocal way: \(t<\lambda\) versus \(t<1/\theta\). Before differentiating, write down the density or explicitly state the convention.

A second common mistake is to call \(E[X^2]\) the variance. It is the second raw moment; variance requires subtracting the squared mean: \(\operatorname{Var}(X)=E[X^2]-(E[X])^2\). For the rate-\(2\), shape-\(3\) example, the raw second moment is \(3\), whereas the variance is \(3-(3/2)^2=3/4\). These quantities are not interchangeable.

Key takeaway: Under the rate convention, gamma raw moments are \((\alpha)^{\overline r}/\lambda^r\); under the scale convention, they are \((\alpha)^{\overline r}\theta^r\). The exponential formulas follow by setting \(\alpha=1\), while central moments require centering rather than simply reading off raw moments.

Check Your Understanding

Use the stated parameterization in each question, and distinguish raw from central moments.

  1. For an exponential variable with rate \(4\), state its MGF and domain, then calculate \(E[X]\) and \(E[X^2]\).
  2. A gamma variable has shape \(5\) and rate \(2\). Calculate its mean, second raw moment, and variance.
  3. Write the MGF domain for a gamma variable with scale \(7\). What is its rate parameter?
  4. For a gamma variable with shape \(\alpha\) and rate \(\lambda\), state its third central moment.
  5. Explain why setting the gamma shape to \(1\) gives \(E[X^r]=r!/\lambda^r\) under the rate convention.