Why Gamma Shape Addition Matters
Gamma distributions describe positive quantities whose densities have a power-law factor near zero and an exponential tail. When two independent quantities have gamma distributions with the same rate, their sum is also gamma distributed: the rate stays fixed, while the shape parameters add. This result is useful because it identifies the full distribution of a sum, not just a feature such as its center or spread.
The common-rate condition is essential. The derivation below uses continuous convolution and a beta integral, and it shows precisely where the two gamma densities combine into a single gamma density.
Gamma and Beta Integrals
The rate is the coefficient multiplying \(x\) in the exponential; it is not the scale parameter. The integral defining \(\Gamma(\alpha)\) is finite and positive for \(\alpha>0\). Substitution \(u=\lambda x\) shows that the stated gamma density integrates to one. We will also use the beta function $$ B(a,b)=\int_0^1 v^{a-1}(1-v)^{b-1}\,dv,\qquad a,b>0. $$ Its connection to the gamma function is the key identity for the convolution.
Here is a derivation. Write the product of the two gamma integrals as a double integral over \(s>0,t>0\). The integrand is nonnegative, so Tonelli's theorem permits expressing the product as this double integral. Make the change of variables \(u=s+t\) and \(v=s/(s+t)\), whose inverse is \(s=uv,\ t=u(1-v)\). The transformed region is \(u>0,\ 0<v<1\), and the absolute Jacobian determinant is \(u\). Therefore
All integrals are finite for \(a,b>0\); the factorization is valid for this nonnegative integrand. Dividing by the positive quantity \(\Gamma(a+b)\) gives the identity.
Convolution Gives Shape Addition
For independent continuous random variables with densities \(f_X\) and \(f_Y\), the density of \(Z=X+Y\) is the continuous convolution $$ f_Z(z)=\int_{-\infty}^{\infty}f_X(x)f_Y(z-x)\,dx. $$ In the gamma case, both variables are positive, so for \(z>0\) the integral reduces to \(0<x<z\); for \(z\leq0\), the sum has density zero.
Proof. Independence permits the convolution formula. For \(z>0\), substitute the two gamma densities and then set \(x=zv\) in the resulting integral. This gives
The last equality uses the beta-gamma identity. For \(z\leq0\), the density is zero because \(X\) and \(Y\) are positive with probability one. The density obtained is exactly that of \(\operatorname{Gamma}(\alpha+\beta,\lambda)\), proving the claim. \(\square\)
The same two-variable result gives a finite-sum version. If \(X_1,\ldots,X_k\) are independent and \(X_i\sim\operatorname{Gamma}(\alpha_i,\lambda)\) for every \(i\), then \(\sum_{i=1}^kX_i\sim\operatorname{Gamma}(\sum_{i=1}^k\alpha_i,\lambda)\). To see this, start with \(X_1\), which has the asserted form with shape \(\alpha_1\). If the sum through \(j\) has shape \(\sum_{i=1}^j\alpha_i\), it is independent of \(X_{j+1}\), since it is a function of \(X_1,\ldots,X_j\) and those variables are independent of \(X_{j+1}\). Applying the two-variable theorem gives shape \(\sum_{i=1}^{j+1}\alpha_i\). Induction proves the statement for every finite \(k\).
Worked Applications
Worked Example: Adding Two Exponential Variables
Let \(X\) and \(Y\) be independent exponential random variables, each with rate \(2\). An exponential density with rate \(2\) is the gamma density with shape \(1\) and rate \(2\), because \(\Gamma(1)=1\). The theorem therefore predicts \(X+Y\sim\operatorname{Gamma}(2,2)\). The convolution verifies the density directly:
For \(z>0\), $$ \begin{aligned} f_{X+Y}(z) &=\int_0^z 2e^{-2x}\,2e^{-2(z-x)}\,dx\\ &=4e^{-2z}\int_0^z dx\\ &=4ze^{-2z}. \end{aligned} $$ For \(z\leq0\), the density is zero. Since \(\Gamma(2)=1\), the \(\operatorname{Gamma}(2,2)\) density is \(2^2z^{2-1}e^{-2z}/\Gamma(2)=4ze^{-2z}\), as obtained. It is normalized: \(\int_0^\infty 4ze^{-2z}\,dz=1\), by the substitution \(u=2z\) and \(\Gamma(2)=1\).
Worked Example: Adding Noninteger Shapes
Suppose \(X\sim\operatorname{Gamma}(1/2,4)\) and \(Y\sim\operatorname{Gamma}(3/2,4)\) independently. The shapes need not be integers. Using \(\Gamma(1/2)=\sqrt{\pi}\), \(\Gamma(3/2)=\sqrt{\pi}/2\), and \(\Gamma(2)=1\), the convolution for \(z>0\) is $$ \begin{aligned} f_{X+Y}(z) &=\frac{16e^{-4z}}{\Gamma(1/2)\Gamma(3/2)} \int_0^z x^{-1/2}(z-x)^{1/2}\,dx\\ &=\frac{16e^{-4z}}{\pi/2}z \int_0^1 v^{-1/2}(1-v)^{1/2}\,dv\\ &=\frac{32}{\pi}ze^{-4z}B(1/2,3/2)\\ &=\frac{32}{\pi}ze^{-4z}\frac{\Gamma(1/2)\Gamma(3/2)}{\Gamma(2)}\\ &=16ze^{-4z}. \end{aligned} $$ Thus \(X+Y\sim\operatorname{Gamma}(2,4)\). Its density integrates to one, since \(\int_0^\infty 16ze^{-4z}\,dz=16\Gamma(2)/4^2=1\). This example confirms that shape addition applies to positive real shapes, not just integer shapes.
Worked Example: Combining Two Integer Shapes
Let independent variables have \(X\sim\operatorname{Gamma}(2,3)\) and \(Y\sim\operatorname{Gamma}(3,3)\). The common rate is \(3\), and the shape parameters are \(2\) and \(3\). The convolution calculation is $$ \begin{aligned} f_{X+Y}(z) &=\frac{3^5e^{-3z}}{\Gamma(2)\Gamma(3)} \int_0^z x(z-x)^2\,dx,\qquad z>0,\\ \int_0^z x(z-x)^2\,dx &=z^4\int_0^1v(1-v)^2\,dv =z^4\left(\frac12-\frac23+\frac14\right) =\frac{z^4}{12}. \end{aligned} $$ Since \(\Gamma(2)=1\) and \(\Gamma(3)=2\), it follows that $$ f_{X+Y}(z)=\frac{3^5}{24}z^4e^{-3z} =\frac{3^5}{\Gamma(5)}z^4e^{-3z},\qquad z>0. $$ Here \(\Gamma(5)=4!=24\), so the density is exactly that of \(\operatorname{Gamma}(5,3)\). Its integral is \(3^5\Gamma(5)/(\Gamma(5)3^5)=1\).
Why a Common Rate Is Necessary
When the rates agree, the exponential factors in the convolution combine as \(e^{-\lambda x}e^{-\lambda(z-x)}=e^{-\lambda z}\), which does not depend on the integration variable. The remaining integral is a beta integral, producing the single power \(z^{\alpha+\beta-1}\). With different rates, that simplification fails, so the shape-addition theorem cannot be used.
Worked Example: Different Rates Do Not Give the Shape-Addition Result
Let independent \(X\sim\operatorname{Gamma}(1,1)\) and \(Y\sim\operatorname{Gamma}(1,2)\). These are exponential variables with different rates. For \(z>0\), $$ \begin{aligned} f_{X+Y}(z) &=\int_0^z e^{-x}\,2e^{-2(z-x)}\,dx\\ &=2e^{-2z}\int_0^z e^x\,dx\\ &=2(e^{-z}-e^{-2z}). \end{aligned} $$ This is not a gamma density obtained by adding the shapes and selecting one of the two rates. For example, the shape-addition guess with rate \(1\) would have density \(ze^{-z}\), while the guess with rate \(2\) would have density \(4ze^{-2z}\); neither equals \(2(e^{-z}-e^{-2z})\). The common-rate theorem makes no claim about this sum.
Common Pitfall and Key Takeaway
- Wrong reasoning: “The sum of two gamma variables is gamma, and the shapes always add.” This drops a necessary condition.
- Correction: Shape addition is guaranteed when the variables are independent and have the same rate. If rates differ, use the convolution with both rates retained; do not apply the theorem.
- Parameterization check: This tutorial uses shape and rate. If a gamma distribution is instead written using shape and scale, the rate is the reciprocal of the scale. Confirm the convention before comparing parameters.
- Support check: The sum of two positive gamma variables has support \(z>0\). A proposed density for the sum must be zero for \(z\leq0\) and integrate to one.
Check Your Understanding
Answer each question by identifying the relevant condition or showing the calculation.
- If independent \(X\sim\operatorname{Gamma}(2,5)\) and \(Y\sim\operatorname{Gamma}(1/2,5)\), what are the parameters of the distribution of \(X+Y\)?
- In the convolution proof, which substitution turns the remaining integral over \(0<x<z\) into a beta integral?
- Why does the theorem not apply directly to independent \(\operatorname{Gamma}(2,3)\) and \(\operatorname{Gamma}(4,6)\) variables?
- For independent gamma variables with shapes \(1,2,3\) and common rate \(7\), state the distribution of their sum.
- Explain why the exponential factor in the convolution becomes constant with respect to \(x\) when the two rates are equal.