Click or press any key to close help Help screen describing the interactive elements

The gamma distribution is a "waiting time" distribution. Suppose events occur independently and randomly with an average time between events of β. The waiting time until α events have occurred is a gamma(α, β) random variable.

The parameter α is known as the shape parameter, and the parameter β is called the scale parameter. Increasing α leads to a more "peaked" distribution, while increasing β increases the "spread" of the distribution.

The function Γ(s) in the denominator of the pdf and cdf denotes the gamma function, while the function γ(s, x) in the cdf denotes the lower incomplete gamma function.

Parameter Range Description
α α > 0 Shape parameter
β β > 0 Scale parameter

Probability Density Function

f ( x ; α , β ) = 1 Γ ( α ) β α x α 1 e x / β
F ( x ; α , β ) = γ ( α , x / β ) Γ ( α )
S ( x ; α , β ) = 1 γ ( α , x / β ) Γ ( α )
h ( x ; α , β ) = x α 1 e x / β β α [ Γ ( α ) γ ( α , x / β ) ]

Support

0 x <

Mean

Variance

Example α β
A radioactive substance emits two alpha particles every second on average. Let X be the waiting time for three particles to be emitted. 3.000 0.5000
Cars arrive at an intersection at an average rate of one every two minutes. Let X be the waiting time until five cars have arrived. 5.000 2.000
Garage door lightbulbs last five years on average and are replaced when they fail. Let X be the time that a box of six bulbs lasts. 6.000 5.000

X ∼ Gamma(α, β)

α = β =
Chart of the gamma distribution Chart area for displaying the gamma pdf, cdf, survival, hazard, visualization, and simulation

E(X) = , Var(X) =

Note that the mean αβ is directly proportional to both α and β. This is what we would intuitively expect - the mean time spent waiting for α events to occur increases in proportion to both the number of events α and the average time β between events.

The shape of the pdf depends on the parameter α. For values of α ≤ 1, the pdf is strictly decreasing. For values of α > 1, the pdf is unimodal.

Note that the mean αβ is directly proportional to both α and β. This is what we would intuitively expect - the mean time spent waiting for α events to occur increases in proportion to both the number of events α and the average time β between events.

The graph above displays the survival function S(x) = P(X > x) = 1 - F(X), where F(x) is the cumulative distribution function (cdf).

Survival functions are used in survival analysis, a branch of statistics concerned with the expected duration until an event occurs such as death or the failure of a mechanical system.

The graph above displays the hazard function h(x). This equals f(x)/S(x), where f(x) is the pdf and S(x) = P(X > x) is the survival function.

Note that:

  • When α < 1, the hazard function decreases with time.
  • When α = 1, the hazard function is constant and independent of time.
  • When α > 1, the hazard function increases with time.
  • The hazard function converges to 1/β as x → ∞.

The illustration above shows events occuring randomly in time independently of other events, with a mean time between events of β. The time at which event number α occurs has a gamma(α, β) distribution.

The simulation above shows events occuring randomly in time independently of other events, with a mean time between events of β. The light blue line shows the time X at which event α occurs, with α rounded to the nearest positive integer. X then has a gamma(α, β) distribution. The histogram accumulates the results of each simulation.

Y = X₁/(X₁ + X₂) ∼ Beta(α₁, α₂) Gamma(α, 2) ∼ Chi-Squared(2α) 2X/β ∼ Chi-Squared(2α) Gamma(1, β) ∼ Exponential(β) ∑ Xᵢ ∼ Gamma(Σαᵢ, β) limα→∞ X ∼ Normal(αβ, αβ²)

Chart of the related distribution Chart area for displaying the related pdf, cdf, and simulation

E(Y) = , Var(Y) =