Tutorials › Statistical Theory I - Probability and Distribution Theory › Convolution and Additivity of Gamma Variables

Uniform, Beta, and Gamma Laws · Tutorial 167 of 994

Convolution and Additivity of Gamma Variables

Use the beta integral to show how independent gamma variables with a common rate combine into a gamma sum.

Beginner 9 min read

What You'll Learn

  • State the gamma density using the shape-rate parameterization.
  • Derive the density of the sum of two independent gamma variables with a common rate.
  • Extend the result to any finite collection of independent gamma variables.
  • Verify the corresponding moment-generating function calculation.
  • Identify why the additivity result does not generally hold when rates differ.

Why Gamma Sums Have a Simple Form

Sums of independent waiting times, accumulated exposures, and other positive quantities often arise in probability models. When the terms have gamma distributions with a common rate, their sum has a gamma distribution too: the rate stays fixed, while the shape parameters add. The convolution integral explains both parts of this rule.

Throughout, the gamma distribution is parameterized by shape \(\alpha>0\) and rate \(\lambda>0\). The rate is the reciprocal of the scale, so keeping the rate fixed is an important condition in the additivity result.

Definition: A random variable \(X\) has a gamma distribution with shape \(\alpha>0\) and rate \(\lambda>0\), written \(X\sim\operatorname{Gamma}(\alpha,\lambda)\), if it has density $$ f_X(x)=\frac{\lambda^\alpha}{\Gamma(\alpha)}x^{\alpha-1}e^{-\lambda x},\qquad x>0, $$ and \(f_X(x)=0\) otherwise. Here \(\Gamma\) is the gamma function. The parameters \(\alpha\) and \(\lambda\) are, respectively, the shape and the rate.

For independent random variables with densities \(f_X\) and \(f_Y\), the density of their sum \(S=X+Y\) is the convolution $$ f_S(s)=\int_{-\infty}^{\infty} f_X(x)f_Y(s-x)\,dx. $$ For gamma variables, both summands must be positive, so when \(s>0\) the integral reduces to \(0<x<s\). When \(s\leq 0\), the sum has density zero.

The Two-Variable Convolution

The key integral is the beta integral: for \(a,b>0\), $$ \int_0^1 u^{a-1}(1-u)^{b-1}\,du =\frac{\Gamma(a)\Gamma(b)}{\Gamma(a+b)}. $$ The positivity conditions matter: they ensure that the integral is finite at both endpoints.

Theorem: If \(X\sim\operatorname{Gamma}(\alpha,\lambda)\) and \(Y\sim\operatorname{Gamma}(\beta,\lambda)\) are independent, with \(\alpha,\beta,\lambda>0\), then $$ X+Y\sim\operatorname{Gamma}(\alpha+\beta,\lambda). $$

Proof. Independence gives the product of the two gamma densities in the convolution. For \(s>0\), $$ \begin{aligned} f_{X+Y}(s) &=\int_0^s \frac{\lambda^\alpha}{\Gamma(\alpha)}x^{\alpha-1}e^{-\lambda x} \frac{\lambda^\beta}{\Gamma(\beta)}(s-x)^{\beta-1}e^{-\lambda(s-x)}\,dx\\ &=\frac{\lambda^{\alpha+\beta}e^{-\lambda s}}{\Gamma(\alpha)\Gamma(\beta)} \int_0^s x^{\alpha-1}(s-x)^{\beta-1}\,dx. \end{aligned} $$ Use \(u=x/s\), so \(x=su\) and \(dx=s\,du\). The integral becomes $$ \int_0^1 (su)^{\alpha-1}\bigl(s(1-u)\bigr)^{\beta-1}s\,du =s^{\alpha+\beta-1}\frac{\Gamma(\alpha)\Gamma(\beta)} {\Gamma(\alpha+\beta)}, $$ where the last equality is the beta integral. Substitution yields $$ f_{X+Y}(s) =\frac{\lambda^{\alpha+\beta}}{\Gamma(\alpha+\beta)} s^{\alpha+\beta-1}e^{-\lambda s},\qquad s>0. $$ This is the \(\operatorname{Gamma}(\alpha+\beta,\lambda)\) density. The sum is positive with probability one, so its density is zero for \(s\leq 0\). \(\square\)

Worked Example: Convolving Two Integer-Shape Gamma Variables

Let \(X\sim\operatorname{Gamma}(2,2)\) and \(Y\sim\operatorname{Gamma}(3,2)\) be independent. Find the density of \(S=X+Y\) directly from the convolution.

From the gamma density and \(\Gamma(2)=1\), \(\Gamma(3)=2\), $$ f_X(x)=4xe^{-2x},\qquad f_Y(y)=4y^2e^{-2y},\qquad x,y>0. $$ For \(s>0\), convolution gives $$ \begin{aligned} f_S(s) &=\int_0^s (4xe^{-2x})\bigl(4(s-x)^2e^{-2(s-x)}\bigr)\,dx\\ &=16e^{-2s}\int_0^s x(s-x)^2\,dx. \end{aligned} $$ Expanding the integrand and integrating, $$ \int_0^s x(s-x)^2\,dx =\int_0^s (s^2x-2sx^2+x^3)\,dx =\frac{s^4}{2}-\frac{2s^4}{3}+\frac{s^4}{4} =\frac{s^4}{12}. $$ Therefore \(f_S(s)=\frac{4}{3}s^4e^{-2s}\) for \(s>0\). Since \(\Gamma(5)=24\), the \(\operatorname{Gamma}(5,2)\) density is $$ \frac{2^5}{\Gamma(5)}s^4e^{-2s} =\frac{32}{24}s^4e^{-2s} =\frac{4}{3}s^4e^{-2s}. $$ The direct calculation agrees with the theorem: the shape is \(2+3=5\), and the rate remains \(2\).

Adding Any Finite Number of Gamma Variables

The two-variable result extends to a finite collection. Independence here means joint independence of the whole collection, not merely that each variable is independent of one selected variable.

Theorem: Let \(X_1,\ldots,X_n\) be mutually independent, with \(X_i\sim\operatorname{Gamma}(\alpha_i,\lambda)\) for each \(i\), where \(n\) is a positive integer and every \(\alpha_i,\lambda\) is positive. Then $$ \sum_{i=1}^n X_i\sim\operatorname{Gamma}\left(\sum_{i=1}^n\alpha_i,\lambda\right). $$

Proof. For \(n=1\), the statement is the assumed distribution of \(X_1\). Suppose it holds for \(n=k\), where \(k\geq1\), and write \(S_k=\sum_{i=1}^kX_i\). By the induction hypothesis, \(S_k\sim\operatorname{Gamma}(\sum_{i=1}^k\alpha_i,\lambda)\). Because the variables are mutually independent, \(S_k\), a measurable function of \(X_1,\ldots,X_k\), is independent of \(X_{k+1}\). The two-variable theorem therefore applies to \(S_k\) and \(X_{k+1}\), giving $$ S_k+X_{k+1}\sim\operatorname{Gamma}\left(\sum_{i=1}^k\alpha_i+\alpha_{k+1},\lambda\right). $$ This is the induction claim for \(k+1\). Hence the result holds for every positive integer \(n\). \(\square\)

Worked Example: A Sum of Three Gamma Variables

Suppose \(X_1,X_2,X_3\) are mutually independent, with $$ X_1\sim\operatorname{Gamma}\left(\frac12,5\right),\qquad X_2\sim\operatorname{Gamma}\left(\frac32,5\right),\qquad X_3\sim\operatorname{Gamma}(2,5). $$ Let \(T=X_1+X_2+X_3\). The rate is \(5\) for all three terms, and their shapes sum to $$ \frac12+\frac32+2=4. $$ Thus \(T\sim\operatorname{Gamma}(4,5)\). Since \(\Gamma(4)=6\), its density is $$ f_T(t)=\frac{5^4}{6}t^3e^{-5t} =\frac{625}{6}t^3e^{-5t},\qquad t>0. $$ As a check that the stated density is normalized, the gamma integral gives $$ \int_0^\infty \frac{625}{6}t^3e^{-5t}\,dt =\frac{625}{6}\frac{\Gamma(4)}{5^4} =\frac{625}{6}\frac{6}{625}=1. $$

A Moment-Generating-Function Check

The convolution proof establishes the distributional result directly. A moment-generating-function calculation offers a compact consistency check. For \(X\sim\operatorname{Gamma}(\alpha,\lambda)\), the moment-generating function is defined at \(t\) when \(E[e^{tX}]\) is finite. For \(t<\lambda\), $$ \begin{aligned} M_X(t) &=\int_0^\infty e^{tx}\frac{\lambda^\alpha}{\Gamma(\alpha)} x^{\alpha-1}e^{-\lambda x}\,dx\\ &=\left(\frac{\lambda}{\lambda-t}\right)^\alpha. \end{aligned} $$ The integral is finite because \(\lambda-t>0\); the last equality follows by the change of variable \(z=(\lambda-t)x\) and the defining gamma integral.

For independent \(X\) and \(Y\) with shapes \(\alpha,\beta\) and common rate \(\lambda\), respectively, their sum has a moment-generating function for \(t<\lambda\). Independence gives $$ M_{X+Y}(t)=M_X(t)M_Y(t) =\left(\frac{\lambda}{\lambda-t}\right)^\alpha \left(\frac{\lambda}{\lambda-t}\right)^\beta =\left(\frac{\lambda}{\lambda-t}\right)^{\alpha+\beta}. $$ This is the moment-generating function of a \(\operatorname{Gamma}(\alpha+\beta,\lambda)\) variable. The product calculation reflects the same addition of shapes as the convolution proof.

Why the Common Rate Condition Matters

The common-rate hypothesis is not a cosmetic restriction. With different rates, the exponential terms in the convolution do not combine into a single shared factor \(e^{-\lambda s}\), so the beta-integral calculation no longer gives a gamma density in general.

Worked Example: Unequal Rates Do Not Give the Same Rule

Let \(X\sim\operatorname{Gamma}(1,1)\) and \(Y\sim\operatorname{Gamma}(1,2)\) be independent. Their densities are \(e^{-x}\) and \(2e^{-2y}\), respectively, for positive arguments. For \(s>0\), $$ \begin{aligned} f_{X+Y}(s) &=\int_0^s e^{-x}\,2e^{-2(s-x)}\,dx\\ &=2e^{-2s}\int_0^s e^x\,dx\\ &=2e^{-2s}(e^s-1)\\ &=2(e^{-s}-e^{-2s}). \end{aligned} $$ This density is not the common-rate additivity formula with the shapes added and a rate carried over: there is no common rate to carry over. In particular, substituting the first variable’s rate would suggest a \(\operatorname{Gamma}(2,1)\) density \(se^{-s}\), which differs from \(2(e^{-s}-e^{-2s})\). At \(s=1\), the two values are \(2(e^{-1}-e^{-2})\) and \(e^{-1}\), which are unequal. Thus differing rates cannot be handled by simply adding shapes and retaining one rate.

Common Mistake and Practical Use

Common mistake: “Gamma shapes add, so the rates add too.” This mixes up parameters. In the theorem, the rates are equal before the variables are added; the convolution proof factors out \(e^{-\lambda s}\), leaving a beta integral that changes the shape to \(\alpha+\beta\). The resulting rate is still \(\lambda\), not \(2\lambda\) or a sum of rates.

When applying the result, check three things: every summand is gamma, the variables are mutually independent, and all rates are the same under the rate parameterization. If any condition fails, the additivity theorem does not apply as stated. When the conditions do hold, the result immediately gives the entire distribution of the sum, not just its mean or variance.

The moment and variance formulas for a gamma variable also give a useful numerical check: a \(\operatorname{Gamma}(\alpha,\lambda)\) variable has mean \(\alpha/\lambda\) and variance \(\alpha/\lambda^2\). For independent summands with common rate, these add to \((\sum_i\alpha_i)/\lambda\) and \((\sum_i\alpha_i)/\lambda^2\), matching the mean and variance of the gamma sum. This check supports the result but does not replace the density proof.

Check Your Understanding

Use the common-rate condition and the convolution result carefully.

  1. If independent \(X\sim\operatorname{Gamma}(2,3)\) and \(Y\sim\operatorname{Gamma}(4,3)\) are added, what is the distribution of \(X+Y\)?
  2. In the two-variable convolution, why does the integral run from \(0\) to \(s\) when \(s>0\)?
  3. Which substitution turns the remaining convolution integral into a beta integral?
  4. Three mutually independent gamma variables have shapes \(1\), \(2\), and \(5/2\), all with rate \(4\). Give the shape and rate of their sum.
  5. Why is it not valid to apply the additivity theorem to independent \(\operatorname{Gamma}(1,1)\) and \(\operatorname{Gamma}(1,2)\) variables?