Gamma Distribution Calculator
The gamma distribution models the total time to accumulate several events in a steady random process, generalising the exponential distribution. Enter the shape parameter k, the scale parameter theta, and an evaluation point x. The calculator returns the probability density at x, the cumulative probability via the regularised incomplete gamma function, and the distribution's mean and variance. It is widely used for rainfall amounts, insurance claim sizes, queueing times, and as the conjugate prior for the rate of a Poisson process. The cumulative value is computed with a standard, well-tested numerical method.
Gamma distribution formulas
f(x) = x^(k-1) * e^(-x/theta) / (gamma(k) * theta^k) for x > 0
F(x) = P(k, x/theta), the regularised lower incomplete gamma function
Mean = k * theta
Variance = k * theta^2
The shape k controls how peaked the distribution is, and the scale theta stretches it along the x axis. When k is 1 the distribution becomes exponential with rate 1 over theta.
Worked example and notes
- With k = 2, theta = 2, the mean is 2 times 2 = 4.
- The variance is 2 times 4 = 8, standard deviation about 2.83.
- At x = 3 the density is 3 times e^(-1.5) / 4, about 0.1673.
- At x = 3 the cumulative probability is about 0.4422.
- Integer k makes gamma(k) equal to (k minus 1) factorial.
Gamma distribution: frequently asked questions
What is the gamma distribution?
The gamma distribution is a continuous distribution on the positive reals defined by a shape parameter k and a scale parameter theta. It generalises the exponential distribution: it models the total waiting time for k events in a Poisson process and the sum of k independent exponential variables.
What is the density of the gamma distribution?
For x greater than 0 the density is x to the power (k minus 1) times e to the power (minus x over theta), divided by the gamma function of k times theta to the power k. The gamma function generalises the factorial: gamma(k) equals (k minus 1)! for whole k.
How is the cumulative probability computed?
The cumulative distribution function is the regularised lower incomplete gamma function P(k, x over theta). This calculator evaluates it with a standard series-and-continued-fraction method, the same approach used in scientific computing libraries.
What are the mean and variance?
The mean is k times theta and the variance is k times theta squared. When k equals 1 the gamma distribution reduces to the exponential distribution with rate 1 over theta.
What are valid inputs?
Both the shape k and the scale theta must be strictly positive. The evaluation point x can be any real number; for x at or below 0 the density and cumulative value are 0, since the gamma distribution is supported on the positive reals.
Official sources
- NIST/SEMATECH e-Handbook of Statistical Methods: Gamma distribution.
- NIST Digital Library of Mathematical Functions: Incomplete gamma functions.
Reviewed by the CalculatorHub team, edited by James Graham, 16 June 2026. See our methodology.