Skip to main content

Section 8.4 Gamma Distribution

Extending the exponential distribution model developed above, consider a Poisson Process where you start with an interval of variable length X so that X measures the interval needed in order to obtain the rth success for some natural number r. Then \(R = (0,\infty)\) and the resulting distribution of X will be called a Gamma distribution.

Definition 8.4.1. Gamma Function.

\begin{equation*} \Gamma(t) = \int_0^{\infty} u^{t-1} e^{-u} du \end{equation*}
Letting n be a natural number and applying integration by parts one time gives
\begin{align*} \Gamma(n+1) & = \int_0^{\infty} u^n e^{-u} du\\ & = -u^n \cdot e^{-u} \big |_0^{\infty} + n \int_0^{\infty} u^{n-1} e^{-u} du \\ & = 0 - 0 + n \Gamma(n) \end{align*}
Continuing using an inductive argument to obtain the final result.
To find the probability function for the gamma distribution, once again focus on the development of F(x). Assuming r is a natural number greater than 1 and noting that X measures the interval length needed in order to achieve the rth success
\begin{align*} F(x) & = P(X \le x)\\ & = 1 - P(X \gt x)\\ & = 1 - P(\text{fewer than r successes in [0,x]})\\ & = 1 - \big [ \frac{(\lambda x)^0 e^{-\lambda x}}{0!} + \frac{(\lambda x)^1 e^{-\lambda x}}{1!} + ... + \frac{(\lambda x)^{r-1} e^{-\lambda x}}{(r-1)!} \big ]\\ & = 1 - \sum_{k=0}^{r-1} \frac{(\lambda x)^k e^{-\lambda x}}{k!} \end{align*}
where the discrete Poisson probability function is used on the interval [0,x]. The derivative of this function however is "telescoping" and terms cancel. Indeed,
\begin{align*} F'(x) & = \lambda e^{-\lambda x}/0!\\ & - \lambda e^{-\lambda x}/1! + \lambda x \cdot \lambda e^{-\lambda x}/1!\\ & - \lambda^2 2x e^{-\lambda x}/2! + \lambda^2 x^2 \cdot \lambda e^{-\lambda x}/2!\\ & - \lambda^3 3x^2 e^{-\lambda x}/3! + \lambda^3 x^3 \cdot \lambda e^{-\lambda x}/3!\\ & . . .\\ & - \lambda^{r-1} (r-1)x^{r-2} e^{-\lambda x}/(r-1)! + \lambda^{r-1} x^{r-1} \cdot \lambda e^{-\lambda x}/(r-1)!\\ & = \lambda^r x^{r-1} e^{-\lambda x}/(r-1)! \end{align*}
where you can replace \((r-1)! = \Gamma(r)\text{.}\)
Notice that for this random variable, \(\mu = \lambda T\) can be obtained for the exponential distribution. For the Gamma distribution, the following takes \(\mu\) to be the average interval till the first success and then modifies the corresponding Gamma parameters according to increasing values of r.
So, to summarize, you get the Gamma Probability Function below.

Definition 8.4.3. Gamma Probability Function.

If \(X\) is a random variable with real parameters \(\lambda\) and \(\alpha\) with probability function
\begin{equation*} f(x) = \frac{x^{\alpha-1} \cdot e^{-\frac{x}{\lambda}}}{\Gamma(\alpha) \cdot \lambda^\alpha} \end{equation*}
then \(X\) is said to have a Gamma Distribution.
The Gamma Distribution is a general one that has some important special cases. We will analyze the Gamma Distributions properties in general but a special case of the Gamma Distribution that extends the exponential distribution is especially appropriate at this point. Indeed, the distribution below considers the case when \(\alpha\) is an integer.

Definition 8.4.4. Weibull Probability Function.

Suppose X measures the interval until the rth success and with parameter \(\lambda\) as the average interval until the 1st success. Then X with probability function
\begin{equation*} f(x) = \frac{x^{r-1} \cdot e^{-\frac{x}{\lambda}}}{\Gamma(r) \cdot \lambda^r} \end{equation*}
has a Weibul Distribution. (Note, this is a special case of the Gamma Distribution and is sometimes called the Gamma Distribution.)
It can be presumed that the life span in years of a certain brand of lightbulbs follows the Poisson process assumptions. Suppose that the mean life span till failure is known to be 0.7 years. To do long-term study, a series of light bulbs are arranged so that when the first one fails, the next one comes on, etc.
Determine the probability that it takes at most 3.5 years before the 4th bulb fails:
Answer.
\(0.73497\)
Solution.
This is a gamma distribution with r = 4 and
\begin{equation*} F(x) = 1 - \sum_{k=0}^3 \frac{ (x/0.7)^k e^{-x/0.7}}{k!} \end{equation*}
So,
\begin{equation*} \begin{aligned} P(X \lt 3.5) \amp = F(3.5)\\ \amp = 1 - \frac{ (3.5/0.7)^0 e^{-3.5/0.7}}{0!} \\ - \frac{ (3.5/0.7)^1 e^{-3.5/0.7}}{1!} \\ - \frac{ (3.5/0.7)^2 e^{-3.5/0.7}}{2!} - \frac{ (3.5/0.7)^3 e^{-3.5/0.7}}{3!}\\ \amp = 1 - e^{-5} - 5 \cdot e^{-5} - \frac{25}{2} \cdot e^{-5} - \frac{125}{6} \cdot e^{-5}\\ \amp = 1 - e^{-5} \left ( 1 + 5 + 25/2 + 125/6 \right ) \approx 0.73497. \end{aligned} \end{equation*}
For the third time, let’s consider a router which, over time, has been shown to receive on average 1000 requests in any given 10 minute period during regular working hours and you want to know the likelihood that it takes more than 4 seconds in order to receive the 5th request. As you have already seen, it takes on average \(\frac{10}{1000} = \frac{1}{100} = 0.01\) minutes to receive the first request so we use that again here. If X were to measure the time interval until the fifth actual request comes in, then the Gamma distribution would be a good model using
\begin{equation*} f(x) = \frac{x^{5-1} \cdot e^{- \frac{x}{0.01}}}{\Gamma(5) \cdot 0.01^5} \end{equation*}
The question above asks for
\begin{equation*} P(X \gt 4 \text{seconds}) = P(X \gt \frac{4}{60} ) = 1 - F(\frac{4}{60}). \end{equation*}
Therefore
\begin{equation*} P(X \gt 4 \text{seconds}) = 1 - F(\frac{4}{60}) \approx 0.205627. \end{equation*}
Again, since X is a continuous variable you must integrate to compute probabilities. This will require integration by parts or you can use the F(x) from the derivation above. Here, let’s just let Sage do the integration for us noting that \(\Gamma(5) = 4! = 24\text{.}\) You can compute the needed integral using the interactive cell immediately below.
This is kind of a tough integral to do. Let’s just evaluate the sage code below.
You can graph the gamma distribution’s probability function for various parameters below. Notice as r increases the curve becomes increasingly bell-shaped whicle changing the mean only shifts the curve around.
Evaluate the interactive cell below to let Sage do the heavy lifting.
Derivation of mean, variance, skewness, and kurtosis. Pick "alpha" for the general formulas.
The interactive cell below can be used to compute the distribution function for the gamma distribution for various input values. If you desire to let r get bigger than the slider allows, feel free to edit the cell above and evaluate again.