From a Gamma Density to a Probability
A gamma density can be integrated directly to obtain a probability, but the resulting integral usually does not simplify to elementary functions. The incomplete gamma functions give a standard notation for these integrals. For integer shape parameters, a recurrence reduces the calculation to a finite sum of exponential terms.
Use the rate parameterization \(X\sim\operatorname{Gamma}(\alpha,\lambda)\), with shape \(\alpha>0\) and rate \(\lambda>0\). Its density is
The scale parameter is \(\beta=1/\lambda\). Thus, if a gamma variable is specified by shape \(\alpha\) and scale \(\beta\), the density has the equivalent form
The distinction between rate and scale matters because the argument of the incomplete gamma function will be \(\lambda x\) in the rate parameterization and \(x/\beta\) in the scale parameterization.
Incomplete Gamma Functions and the Gamma CDF
The adjective “regularized” means that the incomplete integral is divided by the complete gamma integral. This normalization makes \(P(a,z)\) and \(Q(a,z)\) probabilities. Some references use different notation, so it is important to check whether a symbol denotes the unnormalized integral or its regularized version.
To obtain the CDF, start with the density integral and make the change of variable \(u=\lambda t\). When \(x\geq 0\), the limits \(t=0\) and \(t=x\) become \(u=0\) and \(u=\lambda x\), respectively, and \(dt=du/\lambda\). Therefore,
The same substitution in the integral from \(x\) to infinity gives the survival probability. The gamma distribution is continuous, so \(P(X>x)=P(X\geq x)\).
The lower and upper functions are complements. Indeed, their defining integrals split the complete gamma integral at \(z\):
Dividing by the positive quantity \(\Gamma(a)\) proves \(P(a,z)+Q(a,z)=1\). This identity also checks that the CDF and survival formulas agree.
Worked Example: A Gamma CDF and Survival Probability
Let \(X\sim\operatorname{Gamma}(3,2)\), where the second parameter is the rate. Find \(P(X\leq 1)\) and \(P(X>1)\).
Here \(\alpha=3\), \(\lambda=2\), and the incomplete-gamma argument at \(x=1\) is \(z=\lambda x=2\). Since \(\Gamma(3)=2\),
The integer-shape formula derived below gives \(Q(3,2)=e^{-2}(1+2+2^2/2!)=5e^{-2}\). Consequently,
The two values sum to one, as they must. The rate is \(2\), so the argument is \(2(1)=2\), not \(1/2\).
Finite Sums for Integer Shapes
When the shape is a positive integer, integration by parts gives a simple recurrence for the upper incomplete gamma function. For \(a>0\), integrate \(t^a e^{-t}\) from \(z\) to infinity, taking \(t^a\) as the factor to differentiate and \(-e^{-t}\) as the antiderivative. The boundary term at infinity is zero because \(t^a e^{-t}\to 0\). Thus,
For \(a=1\), direct integration gives \(\Gamma(1,z)=e^{-z}\). Repeatedly applying the recurrence yields a finite expression.
To prove the finite-sum identity, use induction on \(m\). The base case \(m=1\) is \(\Gamma(1,z)=e^{-z}=0!e^{-z}\sum_{j=0}^{0}z^j/j!\). Suppose the formula holds for \(m\). The recurrence gives
This is the claimed expression with \(m+1\) in place of \(m\), completing the induction. Dividing by \(\Gamma(m)=(m-1)!\) gives the formula for \(Q(m,z)\); the formula for \(P(m,z)\) follows from \(P(m,z)=1-Q(m,z)\). \(\square\)
The finite sum has exactly \(m\) terms, indexed from \(0\) through \(m-1\). A related identity is \(Q(m,z)=P(N\leq m-1)\) when \(N\) has a Poisson distribution with mean \(z\); it follows by comparing the finite sum with the Poisson probabilities.
Worked Example: An Interval Probability with a Scale Parameter
Suppose \(X\) has shape \(2\) and scale \(\beta=0.5\). Find \(P(0.5<X\leq 1.5)\).
Convert the scale to the rate \(\lambda=1/\beta=2\), or use \(z=x/\beta\) directly. The two thresholds correspond to \(z=1\) and \(z=3\). For shape \(2\), the CDF is \(F(x)=1-e^{-z}(1+z)\), where \(z=x/\beta\). Therefore,
The interval probability is positive and less than one. Subtracting CDF values is appropriate here because the event is bounded by two thresholds.
Using the Formula Carefully
For shapes that are not positive integers, the incomplete-gamma expression remains the standard probability formula, but the finite sum above does not apply. For example, if \(X\sim\operatorname{Gamma}(1/2,4)\), then at \(x=1/4\) the rate-scaled argument is \(z=4(1/4)=1\), so
This is a precise probability even when it is left in special-function form. A numerical value can be obtained from a statistical computing system that evaluates the regularized upper incomplete gamma function.
Worked Example: A Direct Upper-Tail Calculation
Let \(Y\sim\operatorname{Gamma}(4,0.5)\), with rate \(0.5\). Find \(P(Y>6)\).
The shape is the integer \(m=4\), and the argument is \(z=\lambda x=0.5(6)=3\). The upper-tail formula contains terms \(j=0,1,2,3\):
This is a direct survival calculation. It is particularly useful when the requested probability is a tail probability, since no subtraction of two nearly equal numbers is needed.
Common Mistakes and Practical Checks
- Switching rate and scale. With rate \(\lambda\), use \(z=\lambda x\); with scale \(\beta\), use \(z=x/\beta\). The two are equivalent only when \(\lambda=1/\beta\).
- Confusing lower and upper tails. \(P(\alpha,z)\) gives \(P(X\leq x)\), while \(Q(\alpha,z)\) gives \(P(X>x)\). They add to one.
- Using the integer formula for a noninteger shape. The finite sum requires a positive integer shape. For other shapes, use the incomplete gamma function or a numerical evaluation of it.
- Dropping the last term or adding an extra term. For integer shape \(m\), the sum ends at \(m-1\), not \(m\).
- Subtracting from one unnecessarily. If the desired probability is an upper tail, evaluate \(Q(\alpha,\lambda x)\) directly when available. This also avoids loss of numerical precision when the CDF is very close to one.
For an interval \(a<X\leq b\), with \(0\leq a<b\), use \(F(b)-F(a)\). For a threshold below zero, the gamma variable has no probability mass there because its support is positive. These checks keep the special-function formula connected to the event being calculated.
Check Your Understanding
Use the definitions and formulas above to answer the following questions.
- For \(X\sim\operatorname{Gamma}(\alpha,\lambda)\), what argument of the incomplete gamma function corresponds to the threshold \(x\)? How does this change when the distribution is given by scale \(\beta\)?
- Explain why the regularized lower and upper incomplete gamma functions sum to one.
- Write the integer-shape formula for \(P(X>x)\) when \(X\sim\operatorname{Gamma}(5,3)\), without evaluating it numerically.
- For a noninteger shape, which incomplete gamma function gives the survival probability, and why does the finite-sum formula not apply?
- Describe one situation in which direct evaluation of the upper incomplete gamma function is preferable to computing one minus the CDF.