← Back to all blogs

(Series Part 1) Gamma Distribution Deep Dive: The Foundation of Related Distributions

| November 25, 2024

Table of Contents

Introduction

The Gamma distribution is a continuous probability distribution characterized by two parameters: the shape parameter (α\alpha) and the rate parameter (β\beta). It serves as a foundational distribution from which several other important distributions can be derived through specific parameter substitutions.

Probability Density Function (PDF) of Gamma distribution

The probability density function (PDF) of the Gamma distribution is given by:

f(x;α,β)=βαΓ(α)xα1eβx,x>0f(x; \alpha, \beta) = \frac{\beta^\alpha}{\Gamma(\alpha)} x^{\alpha - 1} e^{-\beta x}, \quad x > 0

where Γ(α)\Gamma(\alpha) is:

Γ(α)=0tα1etdt,for α>0\Gamma(\alpha) = \int_0^\infty t^{\alpha - 1} e^{-t} \, dt, \quad \text{for } \alpha > 0

has the following properties that will be used to derive the related distributions:

  1. Recursive Relation:

    Γ(α+1)=αΓ(α)\Gamma(\alpha + 1) = \alpha \, \Gamma(\alpha)
  2. Special Case for Positive Integers (Used in Erlang Distribution):

    Γ(n)=(n1)!,for nN\Gamma(n) = (n - 1)!, \quad \text{for } n \in \mathbb{N}
  3. Value at α=12\alpha = \frac{1}{2} (Used in Chi-Squared Distribution):

    Γ(12)=π\Gamma\left(\frac{1}{2}\right) = \sqrt{\pi}

Erlang Distribution

The Erlang distribution is a special case of the Gamma distribution where the shape parameter (kk) is a positive integer.


Chi-Squared Distribution

The Chi-squared distribution is another special case of the Gamma distribution, widely used in hypothesis testing and confidence interval estimation.


Exponential Distribution

The Exponential distribution is a special case of the Gamma distribution with the shape parameter set to 1.


Weibull Distribution

While not a direct parameter substitution from the Gamma distribution, the Weibull distribution is a separate continuous probability distribution used primarily in reliability engineering and failure analysis.


Poisson Distribution

The Poisson distribution is a discrete probability distribution expressing the probability of a given number of events occurring in a fixed interval of time or space.

Relationship with Gamma Distribution

In Bayesian statistics, the Poisson and Gamma distributions are connected through the concept of conjugate priors. If the number of events follows a Poisson distribution with an unknown rate parameter λ\lambda, and λ\lambda is assumed to follow a Gamma distribution as a prior, then the posterior distribution of λ\lambda given the observed data remains a Gamma distribution. This conjugate prior relationship simplifies the updating of beliefs about λ\lambda after observing data.


Examples

Gamma Distribution

Waiting Time for Multiple Events

Suppose the time between events follows an Exponential distribution with rate β\beta. The time until the α\alpha-th event occurs follows a Gamma distribution with parameters α\alpha (shape) and β\beta (rate).


Erlang Distribution

Telephone Call Center

The time until the kk-th call arrives at a call center can be modeled using the Erlang distribution with shape parameter kk and rate parameter β\beta.


Poisson Distribution

Number of Emails Received

The number of emails a person receives in an hour can be modeled by a Poisson distribution with parameter λ\lambda representing the average number of emails per hour.

Derivation

The Poisson distribution is a discrete probability distribution that expresses the probability of a given number of events occurring in a fixed interval of time or space. It can be derived as a limit of the Binomial distribution under specific conditions.

The Binomial distribution models the number of successes in nn independent trials, each with probability pp of success:

P(X=k)=(nk)pk(1p)nk,k=0,1,2,,nP(X = k) = \binom{n}{k} p^k (1 - p)^{n - k}, \quad k = 0, 1, 2, \dots, n

Limit Conditions:

Using the approximations for large nn and small pp:

(nk)nkk!\binom{n}{k} \approx \frac{n^k}{k!}

and

(1p)nenp=eλ(1 - p)^n \approx e^{-np} = e^{-\lambda}

Substituting these into the Binomial PMF:

P(X=k)λkeλk!P(X = k) \approx \frac{\lambda^k e^{-\lambda}}{k!}

This is the Poisson PMF, demonstrating that under the conditions of a large number of trials and a small probability of success per trial, the Binomial distribution converges to the Poisson distribution with parameter λ=np\lambda = np.

Relationship Between Poisson and Gamma Distributions

As mentioned earlier, in Bayesian statistics, the Poisson and Gamma distributions form a conjugate pair. This means that when the rate parameter λ\lambda of a Poisson distribution is assigned a Gamma prior, the posterior distribution of λ\lambda after observing data remains a Gamma distribution. This property facilitates the updating of beliefs about λ\lambda in a computationally efficient manner.

Derivation: Gamma as a Conjugate Prior for Poisson

Assume the number of events XX follows a Poisson distribution with rate parameter λ\lambda:

P(X=kλ)=λkeλk!,k=0,1,2,P(X = k | \lambda) = \frac{\lambda^k e^{-\lambda}}{k!}, \quad k = 0, 1, 2, \dots

Suppose the prior distribution of λ\lambda is a Gamma distribution with parameters α\alpha (shape) and β\beta (rate):

p(λ)=βαΓ(α)λα1eβλ,λ>0p(\lambda) = \frac{\beta^\alpha}{\Gamma(\alpha)} \lambda^{\alpha - 1} e^{-\beta \lambda}, \quad \lambda > 0

Posterior Distribution:

Using Bayes’ theorem, the posterior distribution of λ\lambda given X=kX = k is:

p(λX=k)P(X=kλ)p(λ)p(\lambda | X = k) \propto P(X = k | \lambda) \cdot p(\lambda)

Substituting the expressions:

p(λX=k)λkeλk!βαΓ(α)λα1eβλp(\lambda | X = k) \propto \frac{\lambda^k e^{-\lambda}}{k!} \cdot \frac{\beta^\alpha}{\Gamma(\alpha)} \lambda^{\alpha - 1} e^{-\beta \lambda}

Simplifying (constants can be absorbed into the proportionality):

p(λX=k)λk+α1e(β+1)λp(\lambda | X = k) \propto \lambda^{k + \alpha - 1} e^{-(\beta + 1)\lambda}

This is the kernel of a Gamma distribution with updated parameters:

Therefore, the posterior distribution is:

p(λX=k)Γ(α+k,β+1)p(\lambda | X = k) \sim \Gamma(\alpha + k, \beta + 1)

Interpretation:

After observing kk events, the updated belief about the rate parameter λ\lambda is captured by a Gamma distribution with increased shape and rate parameters. This conjugate relationship simplifies Bayesian updating, as the posterior remains in the same family as the prior.


Chi-Squared Distribution

The Chi-squared distribution is a special case of the Gamma distribution and is widely used in statistical hypothesis testing and confidence interval estimation.

Goodness-of-Fit Test

In a Chi-squared goodness-of-fit test, the test statistic follows a Chi-squared distribution with degrees of freedom equal to the number of categories minus one. This test assesses whether observed frequencies differ from expected frequencies under a specific hypothesis.


Weibull Distribution

The Weibull distribution is a continuous probability distribution used extensively in reliability engineering and failure analysis. It is characterized by its scale parameter (λ\lambda) and shape parameter (kk).

Time to Failure of a Mechanical Component

The lifespan of a mechanical component can be modeled using the Weibull distribution. The shape parameter kk indicates the failure rate behavior:

Example:

A component with k=2k = 2 and λ=1000\lambda = 1000 hours suggests that the failure rate increases with time, modeling wear-out behavior.


Conclusion