Gamma Distribution
Recap
- Exponential distribution models waiting time until the next event in a Poisson process.
- The number of events in time \(T\) follows a Poisson(λT) distribution.
-
Events occur at times \(T₁, T₂, T₃, ...\)
The waiting times between them are exponential.
Beyond the First Event
- What if we want the waiting time until the r-th event, not just the next one?
- This leads to the Gamma distribution.
Definition: Gamma Distribution (Generalizing Exponential Waiting Times)
Let:
- \(Tᵣ = W₁ + W₂ + ... + Wᵣ\) be the waiting time for the r-th event.
- Each \(Wⱼ\) is independent and follows Exponential(λ).
Then:
- \(r\): number of events we are waiting for
- \(\lambda\): event rate
Gamma has two parameters: \(r\) and \(\lambda\)
Exponential is a special case when \(r = 1\).
Derivation Sketch (without messy math)
To compute:
Continuous waiting time for \(r^{th}\) arrival
This is the same as:
Which is:
of Poisson events that occur in time \(t\)
Where \(N(t)\) is the number of Poisson events in time \(t\).
This is the CDF (complement) of the Gamma distribution.
Take the derivative to get the PDF:
This is the Gamma probability density function.
Descriptive Statistics
| Type | Formula |
|---|---|
| Support | \(t \in [0, \infty)\) |
| Shape Parameter | \(r > 0\) (number of events) |
| Rate Parameter | \(\lambda > 0\) |
| Mean | \(\mathbb{E}[T] = \frac{r}{\lambda}\) |
| Variance | \(\text{Var}(T) = \frac{r}{\lambda^2}\) |
| Standard Deviation | \(\sigma = \sqrt{\frac{r}{\lambda^2}}\) |
| Probability Density Function (PDF) | \(f(t) = \frac{\lambda^r t^{r-1} e^{-\lambda t}}{(r-1)!} \quad \text{for } t \geq 0\) |
| Cumulative Distribution Function (CDF) | \(F(t) = \mathbb{P}(T \leq t) = \int_0^t f(s)\, ds \quad or \quad \frac{\gamma(r, \lambda t)}{\Gamma(r)}\) |
Use Case Example
DMV Analogy (Series Case)
- You must speak to three agents, one after another.
- (Mean of Exp. Distribution) Each has a 15-minute exponential wait ⇒ \(λ = \frac{1}{15}\)
Total wait time is the sum of 3 exponential variables:
Clarification: Series vs Parallel
Series (Gamma): You wait for 3 stages one after another
e.g. DMV → agent A → agent B → agent C
→ Waiting time follows Gamma
Mean and Variance
For \(T \sim \text{Gamma}(r, \lambda)\), where:
- \(r=3\)
- \(\lambda = \frac{1}{15}\)
Then:
- Mean: \(\mathbb{E}[T] = \frac{r}{\lambda} = \frac{3}{1/15} = 45 \text{ minutes}\)
- Variance: \(\text{Var}(T) = \frac{r}{\lambda^2} = \frac{3}{(1/15)^2} = 3 \cdot 225 = 675\)
Probability Density Function (PDF)
The PDF of the Gamma distribution is:
Substitute values:
So:
This gives the probability density at time \(t\), in minutes.
Parallel (Not Gamma, Exponential):
3 open lanes, choose the shortest
→ Minimum of exponential variables
→ Not Gamma, uses Exponential Distribution
For the parallel case, you are taking the minimum of 3 independent exponential wait times, each with: \(\lambda = \frac{1}{15}\)
This gives:
Mean and Variance
For \(T \sim \text{Exponential}(\lambda)\), we have:
- Mean: \(\mathbb{E}[T] = \frac{1}{\lambda} = 5 \text{ minutes}\)
- Variance: \(\text{Var}(T) = \frac{1}{\lambda^2} = 25\)
Probability Density Function (PDF)
The PDF is: \(f(t) = \lambda e^{-\lambda t}\)
Substitute \(\lambda = \frac{1}{5}\): \(f(t) = \frac{1}{5} e^{-t/5}\)
This gives the probability density for being helped at time \(t\), when choosing the fastest of 3 lanes.