Tutorials › VEE Mathematical Statistics › Gamma Moments and the Mode

VEE Mathematical Statistics · Gamma, Beta, and Normal Models · Tutorial 199 of 880

Gamma Moments and the Mode

Use the gamma density to derive and interpret its mean, variance, and mode for different shape-rate parameter choices.

Intermediate 10 min read

What You'll Learn

  • Identify the shape and rate parameters in a gamma density
  • Derive raw moments using the gamma-function recurrence
  • Calculate a gamma random variable’s mean and variance
  • Determine whether its mode is interior or at the boundary
  • Compare gamma distributions with different shapes and rates
  • Avoid confusing rate with scale when interpreting results

Why Gamma Moments and the Mode Matter

A gamma distribution describes a nonnegative continuous quantity whose values may be concentrated near zero, spread broadly, or clustered around a positive value. Its shape and rate parameters determine these features. The mean gives a measure of the distribution’s center, the variance measures its spread, and the mode identifies where the density is highest. These summaries answer different questions: the mode is not generally the same as the mean.

For example, a hypothetical analyst might model a positive service duration in hours with a gamma distribution. The parameters must be interpreted using those hours: the rate is measured per hour, while the shape is dimensionless. The formulas below are also useful in other nonnegative continuous models. No interest-rate or mortality assumption is involved in these probability calculations.

Definition: Let \(X\) have a gamma distribution with shape \(\alpha>0\) and rate \(\beta>0\), written \(X\sim\operatorname{Gamma}(\alpha,\beta)\). Its density is $$ f_X(x)=\frac{\beta^\alpha}{\Gamma(\alpha)}x^{\alpha-1}e^{-\beta x},\qquad x>0, $$ and \(f_X(x)=0\) otherwise. Here \(\Gamma(\alpha)=\int_0^\infty t^{\alpha-1}e^{-t}\,dt\). The rate \(\beta\) has units reciprocal to those of \(X\).

The shape-rate parameterization is important. Some sources instead use a scale parameter \(\theta\), where \(\theta=1/\beta\). Thus, in shape-scale notation, the same density uses \(\theta^{-\alpha}x^{\alpha-1}e^{-x/\theta}/\Gamma(\alpha)\). A larger rate means a smaller scale; treating the rate as a scale reverses the effect of the parameter.

Deriving the Raw Moments

A raw moment of order \(r\) is \(E[X^r]\), when the expectation exists. For a gamma random variable, the density makes this expectation an integral that can be expressed using the gamma function. For \(r>-\alpha\), the integral is finite:

$$ \begin{aligned} E[X^r] &=\int_0^\infty x^r f_X(x)\,dx\\ &=\frac{\beta^\alpha}{\Gamma(\alpha)} \int_0^\infty x^{\alpha+r-1}e^{-\beta x}\,dx. \end{aligned} $$

To evaluate the integral, set \(t=\beta x\), so \(x=t/\beta\) and \(dx=dt/\beta\). Substitution gives

$$ \begin{aligned} E[X^r] &=\frac{\beta^\alpha}{\Gamma(\alpha)} \int_0^\infty \left(\frac{t}{\beta}\right)^{\alpha+r-1} e^{-t}\frac{dt}{\beta}\\ &=\frac{\beta^\alpha}{\Gamma(\alpha)\beta^{\alpha+r}} \int_0^\infty t^{\alpha+r-1}e^{-t}\,dt\\ &=\frac{\Gamma(\alpha+r)}{\Gamma(\alpha)\beta^r}. \end{aligned} $$

The condition \(r>-\alpha\) ensures that the gamma integral at zero is finite; for the mean and second raw moment, \(r=1\) and \(r=2\), this condition holds whenever \(\alpha>0\). The gamma-function recurrence \(\Gamma(z+1)=z\Gamma(z)\) follows by integration by parts in its defining integral: the boundary term vanishes for \(z>0\), leaving \(\Gamma(z+1)=z\Gamma(z)\).

Theorem: If \(X\sim\operatorname{Gamma}(\alpha,\beta)\) with \(\alpha,\beta>0\), then $$ E[X]=\frac{\alpha}{\beta},\qquad E[X^2]=\frac{\alpha(\alpha+1)}{\beta^2},\qquad \operatorname{Var}(X)=\frac{\alpha}{\beta^2}. $$

The first two formulas follow by applying the raw-moment expression and the recurrence:

$$ E[X]=\frac{\Gamma(\alpha+1)}{\Gamma(\alpha)\beta} =\frac{\alpha}{\beta}, \qquad E[X^2]=\frac{\Gamma(\alpha+2)}{\Gamma(\alpha)\beta^2} =\frac{\alpha(\alpha+1)}{\beta^2}. $$

Variance is the second central moment, \(\operatorname{Var}(X)=E[X^2]-(E[X])^2\). Therefore,

$$ \operatorname{Var}(X) =\frac{\alpha(\alpha+1)}{\beta^2} -\left(\frac{\alpha}{\beta}\right)^2 =\frac{\alpha}{\beta^2}. $$

The standard deviation is \(\sqrt{\alpha}/\beta\). In particular, with shape held fixed, doubling the rate halves the mean and quarters the variance. The units also provide a useful check: if \(X\) is measured in hours, \(\beta\) is per hour, the mean is in hours, and the variance is in hours squared.

Worked Example: Mean and Variance of a Service Duration

Problem. In a hypothetical service study, a duration \(X\), measured in hours, is modeled as \(\operatorname{Gamma}(4,2)\). Find the mean, variance, standard deviation, and mode. State how the rate is measured.

Method and parameter check. The shape is \(\alpha=4\), and the rate is \(\beta=2\) per hour. This is a shape-rate model, not a shape-scale model.

Mean. $$ E[X]=\frac{\alpha}{\beta}=\frac{4}{2}=2\text{ hours}. $$

Variance and standard deviation. $$ \operatorname{Var}(X)=\frac{\alpha}{\beta^2} =\frac{4}{2^2}=\frac{4}{4}=1\text{ hour}^2, \qquad \operatorname{SD}(X)=\sqrt{1}=1\text{ hour}. $$

Mode. Since \(\alpha=4>1\), the mode is interior and equals $$ \frac{\alpha-1}{\beta}=\frac{4-1}{2}=\frac{3}{2}=1.5\text{ hours}. $$ The mode is below the mean of 2 hours, which is consistent with a right-skewed gamma density.

Check and mistake avoided. The variance has units of hours squared, and its value is positive. Using \(2\) as a scale would instead produce a mean of \(4(2)=8\) hours; that is not the stated rate parameterization.

Finding the Mode

The mode is a location where the density reaches its greatest value. For an interior maximum, differentiate the log density; this is simpler than differentiating the full density and gives the same critical points because the logarithm is strictly increasing wherever the density is positive.

$$ \log f_X(x) =\alpha\log\beta-\log\Gamma(\alpha) +(\alpha-1)\log x-\beta x, \qquad \frac{d}{dx}\log f_X(x)=\frac{\alpha-1}{x}-\beta. $$

If \(\alpha>1\), setting the derivative equal to zero gives \(x=(\alpha-1)/\beta\). The derivative is positive for \(0<x<(\alpha-1)/\beta\) and negative for \(x>(\alpha-1)/\beta\), so the density increases up to that point and decreases after it. This establishes that it is the mode.

When \(\alpha=1\), the density is \(\beta e^{-\beta x}\), which decreases for \(x>0\). Its largest limiting value is at the boundary \(x=0\); the mode is conventionally reported as 0. When \(0<\alpha<1\), the factor \(x^{\alpha-1}\) makes the density grow without bound as \(x\) approaches zero from the right. There is no finite interior maximum; the boundary location is described as the mode at 0, with an unbounded density there.

Result: For \(X\sim\operatorname{Gamma}(\alpha,\beta)\), the interior mode is \((\alpha-1)/\beta\) when \(\alpha>1\). For \(\alpha=1\), the mode is at the boundary 0. For \(0<\alpha<1\), the density is unbounded as \(x\to0^+\), so its mode is described as the boundary location 0 rather than a finite interior maximum.

Worked Example: Recognizing a Boundary Mode

Problem. A hypothetical positive claim-processing time \(X\), measured in days, has distribution \(\operatorname{Gamma}(0.6,3)\). Find its mean, variance, and mode behavior. The rate is 3 per day.

Method. Use the mean and variance formulas with \(\alpha=0.6\) and \(\beta=3\), then compare the shape with 1 to determine the mode.

Mean. $$ E[X]=\frac{0.6}{3}=0.2\text{ days}. $$

Variance. $$ \operatorname{Var}(X)=\frac{0.6}{3^2} =\frac{0.6}{9}=0.066666\ldots\text{ days}^2. $$ Rounded to four decimal places, the variance is \(0.0667\text{ days}^2\).

Mode behavior. Because \(0.6<1\), this density is unbounded as \(x\to0^+\). Its mode is described as the boundary location 0; the interior-mode formula \((\alpha-1)/\beta\) does not apply. Substituting into that formula would give \((0.6-1)/3=-0.1333\ldots\) days, a negative value outside the support and not a valid mode.

Check and mistake avoided. The mean is positive and the variance is positive, as required for this nonnegative model. A negative result from the interior-mode formula signals that the shape condition \(\alpha>1\) has been violated; it does not indicate a negative-valued mode.

How Shape and Rate Change the Distribution

The formulas distinguish the roles of shape and rate. At a fixed rate, increasing the shape increases the mean, variance, and—once the shape exceeds 1—the interior mode. At a fixed shape, increasing the rate decreases the mean and mode in inverse proportion and decreases the variance in inverse proportion to the rate squared. The shape also determines whether the density rises without bound near zero or has an interior peak.

Different parameter pairs can have the same mean but different spreads and modes. If the mean is fixed at \(m>0\), then choosing \(\beta=\alpha/m\) gives $$ \operatorname{Var}(X)=\frac{m^2}{\alpha}. $$ Thus, among gamma distributions with the same mean, a larger shape means a smaller variance. This relationship is useful when comparing plausible models, but it does not imply that the distributions are identical.

Worked Example: Same Mean, Different Spread and Mode

Problem. Two hypothetical measurements, each in hours, are modeled by \(X_1\sim\operatorname{Gamma}(3,1.5)\) and \(X_2\sim\operatorname{Gamma}(6,3)\). Compare their means, variances, and modes. Both rates are per hour.

Method. Apply the shape-rate formulas separately, and check whether each shape exceeds 1 before using the interior-mode formula.

First distribution. For \(\alpha_1=3\) and \(\beta_1=1.5\), $$ E[X_1]=\frac{3}{1.5}=2\text{ hours}, \qquad \operatorname{Var}(X_1)=\frac{3}{1.5^2} =\frac{3}{2.25}=\frac{4}{3}\text{ hours}^2. $$ Since \(3>1\), $$ \operatorname{Mode}(X_1)=\frac{3-1}{1.5} =\frac{2}{1.5}=\frac{4}{3}\text{ hours}. $$

Second distribution. For \(\alpha_2=6\) and \(\beta_2=3\), $$ E[X_2]=\frac{6}{3}=2\text{ hours}, \qquad \operatorname{Var}(X_2)=\frac{6}{3^2} =\frac{6}{9}=\frac{2}{3}\text{ hours}^2. $$ Since \(6>1\), $$ \operatorname{Mode}(X_2)=\frac{6-1}{3} =\frac{5}{3}\text{ hours}. $$

Comparison and check. Both means are 2 hours, but \(X_2\) has the smaller variance: \(2/3<4/3\). Its mode, \(5/3\) hours, is also closer to the common mean than \(X_1\)'s mode, \(4/3\) hours. The common mistake is to infer that equal means imply equal distributions; the unequal variances show otherwise.

Exam Traps and Practical Checks

A reliable calculation begins by identifying which gamma parameterization is being used and what units the variable has. Then calculate the mean and variance directly, and check the shape before reporting a mode. These checks catch errors that a calculator alone will not identify.

  • Swapping rate and scale. With rate \(\beta\), the mean is \(\alpha/\beta\), not \(\alpha\beta\). If the problem provides a scale \(\theta\), convert using \(\beta=1/\theta\), or use the equivalent mean \(\alpha\theta\).
  • Using the interior-mode formula without checking shape. The formula \((\alpha-1)/\beta\) applies only when \(\alpha>1\). For \(\alpha\leq1\), describe the boundary behavior instead.
  • Confusing variance and standard deviation. The variance is \(\alpha/\beta^2\); the standard deviation is \(\sqrt{\alpha}/\beta\). They also have different units.
  • Ignoring units. If the variable is in days, the rate must be per day, the mean and mode are in days, and the variance is in days squared.

For a final reasonableness check, a gamma variable is positive, so its mean must be positive and its variance cannot be negative. When \(\alpha>1\), its mode \((\alpha-1)/\beta\) must also be positive and below the mean, since \((\alpha-1)/\beta<\alpha/\beta\). These checks do not replace the calculation, but they can reveal a parameter or arithmetic mistake.

Check Your Understanding

For each problem, identify the shape and rate before calculating. Rates are stated in reciprocal units of the measured variable.

  1. A hypothetical repair time \(X\), measured in days, has distribution \(\operatorname{Gamma}(5,2)\). Find its mean, variance, and mode. (Answer: mean \(2.5\) days, variance \(1.25\) days squared, mode \(2\) days.)
  2. A positive measurement \(Y\), in hours, has distribution \(\operatorname{Gamma}(2,0.4)\). Find its mean, variance, and mode. (Answer: mean \(5\) hours, variance \(12.5\) hours squared, mode \(2.5\) hours.)
  3. A hypothetical duration \(Z\), in minutes, has distribution \(\operatorname{Gamma}(0.8,4)\). Find its mean and variance, and state the mode behavior. (Answer: mean \(0.2\) minutes, variance \(0.05\) minutes squared, boundary mode at 0 with density unbounded as \(z\to0^+\).)
  4. Compare \(U\sim\operatorname{Gamma}(4,2)\) and \(V\sim\operatorname{Gamma}(9,4.5)\), both measured in hours. Find their means, variances, and modes. (Answer: both means are \(2\) hours; variances are \(1\) and \(4/9\) hours squared, respectively; modes are \(1.5\) and \(16/9\) hours, respectively.)
  5. A gamma variable \(W\) has mean \(3\) days and variance \(1.5\) days squared. Determine its shape and rate, then find its mode. (Answer: shape \(\alpha=6\), rate \(\beta=2\) per day, mode \(2.5\) days.)
Clinical Biostats