given the mean number of events per unit time (๐):
- the total time of ๐ผ events has Gamma Distribution
- the number of events occurring within that unit time has Poisson Distribution
- the time between events has Exponential Distribution
Probability Density Function #1
- ๐(๐ฅ) = (๐๐ผ/๐ค(๐ผ))ยท๐ฅ๐ผ-1ยท๐-๐๐ฅ# for ๐ฅ > 0
where:
- ๐ผ - number of events
- ๐ - number of events per unit time
- ๐ค(๐ผ) = gamma functionย = (๐ผ - 1)!
special cases of a Gamma Distribution:
- Gamma(๐ผ=1, ๐) = Exponential(๐)
- Gamma(๐ผ>0, ๐=1/2) = Chi-Square(2๐ผ)
Probability Density Function #2
- ๐(๐ฅ) = [1/(๐ค(๐ผ)๐๐ผ)]ยท๐ฅ๐ผ-1ยท๐-๐ฅ/๐# for ๐ฅ > 0
Expectation
๐[๐]ย = ๐ผ/๐
proof
via exponential distribution Exponential(๐) variables ๐1, ..., ๐๐ผ
๐ = ๐1 + โฆ + ๐๐ผ
- ๐[๐] = ๐[๐1 + โฆ + ๐๐ผ]
- ๐[๐] = ๐[๐1] + โฆ + ๐[๐๐ผ]
- ๐[๐] = 1/๐ + โฆ + 1/๐
- ๐[๐] = ๐ผ/๐
representing a Gamma variable ๐ as a sum of independent
way 2 โ๐(๐ฅ)๐๐ฅ = 1 for Gamma and all the other densities
- 1 = โโซโ๐(๐ฅ)๐๐ฅ
- 1 = โโซโ(๐๐ผ/๐ค(๐ผ)) (๐ฅ๐ผ-1๐-๐๐ฅ) ๐๐ฅ
- 1 = (๐๐ผ/๐ค(๐ผ)) โโซโ(๐ฅ๐ผ-1๐-๐๐ฅ) ๐๐ฅ
- ๐ค(๐ผ)/๐๐ผ = โโซโ(๐ฅ๐ผ-1๐-๐๐ฅ) ๐๐ฅ
- ๐ค(๐ผ+1)/๐๐ผ+1 = โโซโ(๐ฅ๐ผ๐-๐๐ฅ) ๐๐ฅ
now compute expectation:
- ๐[๐] = โโซโ๐ฅ ๐(๐ฅ)๐๐ฅ
- ๐[๐] = โโซโ๐ฅ (๐๐ผ/๐ค(๐ผ)) (๐ฅ๐ผ-1๐-ฮป๐ฅ) ๐๐ฅ
- ๐[๐] = (๐๐ผ/๐ค(๐ผ)) โโซโ๐ฅ(๐ฅ๐ผ-1๐-ฮป๐ฅ) ๐๐ฅ
- ๐[๐] = (๐๐ผ/๐ค(๐ผ)) โโซโ๐ฅ๐ผ๐-ฮป๐ฅ ๐๐ฅ
- ๐[๐] = (๐๐ผ/๐ค(๐ผ)) * (๐ค(๐ผ+1)/๐๐ผ+1)
- ๐[๐] = (๐ค(๐ผ+1)/๐ค(๐ผ)) * (๐๐ผ/๐๐ผ+1)
- ๐[๐] = [(๐ผ)! / (๐ผ-1)!] * (1/๐)
- ๐[๐] = (๐ผ) * (1/๐)
- ๐[๐] = ๐ผ/๐
First, note that โโซ
Variance
๐๐๐(๐) = ๐ผ/๐2
proof
via exponential distribution Exponential(ฮป) variables ๐1, ..., ๐๐ผ
๐ = ๐1 + โฆ + ๐๐ผ
- ๐๐๐(๐) = ๐๐๐(๐1 + โฆ + ๐๐ผ)
- ๐๐๐(๐) = ๐๐๐(๐1) + โฆ + ๐๐๐(๐๐ผ) # because of independence
- ๐๐๐(๐) = 1/๐2 + โฆ + 1/๐2
- ๐๐๐(๐) = ๐ผ/๐2
representing a Gamma variable ๐ as a sum of INDEPENDENT
way 2 โ๐(๐ฅ)๐๐ฅ = 1 for Gamma and all the other densities
- 1 = โโซโ๐(๐ฅ)๐๐ฅ
- 1 = โโซโ(๐๐ผ/๐ค(๐ผ)) (๐ฅ๐ผ-1๐-๐๐ฅ) ๐๐ฅ
- 1 = (๐๐ผ/๐ค(๐ผ)) โโซโ(๐ฅ๐ผ-1๐-๐๐ฅ) ๐๐ฅ
- ๐ค(๐ผ)/๐๐ผ = โโซโ(๐ฅ๐ผ-1๐-๐๐ฅ) ๐๐ฅ
- ๐ค(๐ผ+2)/๐๐ผ+2 = โโซโ(๐ฅ๐ผ+1๐-๐๐ฅ) ๐๐ฅ
now compute expectation:
- ๐๐๐(๐) =ย [โโซโ๐ฅ2๐(๐ฅ)๐๐ฅ] -ย ๐2
- ๐๐๐(๐) =ย [โโซโ๐ฅ2(๐๐ผ/๐ค(๐ผ)) (๐ฅ๐ผ-1๐-๐๐ฅ)๐๐ฅ] -ย (๐ผ/๐)2
- ๐๐๐(๐) =ย [(๐๐ผ/๐ค(๐ผ)) โโซโ๐ฅ2(๐ฅ๐ผ-1๐-๐๐ฅ)๐๐ฅ] -ย (๐ผ/๐)2
- ๐๐๐(๐) =ย [(๐๐ผ/๐ค(๐ผ)) โโซโ๐ฅ๐ผ+1๐-๐๐ฅ๐๐ฅ] -ย (๐ผ/๐)2
- ๐๐๐(๐) =ย [(๐๐ผ/๐ค(๐ผ)) (๐ค(๐ผ+2)/๐๐ผ+2)] -ย (๐ผ/๐)2
- ๐๐๐(๐) =ย [(๐ค(๐ผ+2)/๐ค(๐ผ)) * (๐๐ผ/๐๐ผ+2)] -ย (๐ผ/๐)2
- ๐๐๐(๐) =ย [((๐ผ+1)! / (๐ผ-1)!) * (1/๐2)] -ย (๐ผ/๐)2
- ๐๐๐(๐) =ย [(๐ผ(๐ผ+1)) * (1/๐2)] -ย (๐ผ/๐)2
- ๐๐๐(๐) =ย [(๐ผ2+ ๐ผ) * (1/๐2)] -ย (๐ผ/๐)2
- ๐๐๐(๐) = ๐ผ2/๐2+ ๐ผ/๐2 -ย (๐ผ/๐)2
- ๐๐๐(๐) = (๐ผ/๐)2+ ๐ผ/๐2 -ย (๐ผ/๐)2
- ๐๐๐(๐) = ๐ผ/๐2
First, note that โโซ
Cumulative Distribution Function (CDF)
/gamma-distribution/gamma-distribution-cumulative-distribution-function.png)
Moment-Generating Function
When the PDF of gamma variable ๐ is:
- ๐(๐ฅ) = [1/(๐ค(๐ผ)๐๐ผ)]ยท๐ฅ๐ผ-1ยท๐-๐ฅ/๐# for ๐ฅ > 0
Then the moment-generating function of ๐ is:
See: Moment-Generating Function - Gamma Distribution
Example 1
Users visit a certain internet site at the average rate of 12 hits per minute. Every sixth visitor receives some promotion that comes in a form of a flashing banner. Then the time between consecutive promotions has Gamma distribution with parameters ๐ผ = 6 andย ๐ย = 12
Example 2
Compilation of a computer program consists of 3 blocks that are processed sequentially, one after another. Each block takes Exponential time with the mean of 5 minutes, independently of other blocks
- ๐ผ = 3
- ๐ย = 1/5
Compute the expectation and variance of the total compilation time
solution
๐[๐] = ๐ผ/๐
๐[๐]ย = 3/(1/5)
๐[๐] = 15
๐๐๐(๐)ย = ๐ผ/๐2
๐๐๐(๐)ย =ย 3/(1/5)2
๐๐๐(๐)ย = 75
Compute the probability for the entire program to be compiled in less than 12 minutes
solution
- ๐ทย {๐ < 12} = ๐ถ๐ท๐น(๐ฅ=12)
- ๐ทย {๐ < 12} = ๐ถ๐ท๐น(๐ฅ=12)
- ๐ทย {๐ < 12} = โโซ12((1/5)3/๐ค(3)) (๐ฅ3-1๐-(1/5)๐ฅ)๐๐ฅ
- ๐ทย {๐ < 12} = (1/5)3/๐ค(3) โโซ12๐ฅ2๐-๐ฅ/5๐๐ฅ
- ๐ทย {๐ < 12} = (1/5)3/๐ค(3) โฆ requires 2 rounds ofย integration by parts