How to use the gamma distribution calculator
- Enter the shape k. For a whole number this is the number of events in a waiting time.
- Choose whether the second parameter is a rate or a scale, and enter it. A rate is one over the scale.
- Choose Probability at a value or Value for probability, and enter the value or the probability.
- Read the probability below and above, the density, and the mean, variance, standard deviation, mode and the rate and scale.
Formula
Density: f(x) = rate^k x^(k-1) e^(-rate x) / Gamma(k), for x above 0
Probability below x: the regularized lower incomplete gamma function P(k, rate x)
Mean = k / rate, variance = k / rate^2, mode = (k - 1) / rate for k of at least 1
A value for a probability is found by solving the probability below x for x
With a whole-number shape the gamma distribution is also called an Erlang distribution: the waiting time for k events in a Poisson process with a given rate.
Shape 3 with a rate of 2
For shape 3 and rate 2, the mean is 1.5, the variance is 0.75, the standard deviation is 0.86603 and the mode is 1. The probability that X is at most 1 is 0.32332, which equals 1 - e^(-2) (1 + 2 + 2). The density at 1 is 0.54134, and the 95th percentile is 3.1479.
With shape 2 and a scale of 5 (a rate of 0.2), the mean is 10, the variance is 50, and the probability of a value at most 10 is 0.59399.
Shape, rate and scale
The shape controls the form of the curve. A shape of 1 is the exponential distribution, which has its highest density at 0. A larger shape moves the peak to the right and makes the curve more symmetric. The rate stretches the curve along the axis, so doubling the rate halves every time. Books differ on whether they use a rate or a scale, and this page shows both so you can match your source.
For waiting times for one event, use the exponential distribution calculator. For counts of events in a fixed time, see the Poisson distribution calculator.
Where it is used
The gamma distribution models waiting times, rainfall amounts, insurance claims, the time to complete several steps and many other positive, skewed quantities. It is also the conjugate prior for the rate of a Poisson process in Bayesian work, and the chi-square distribution is a special case. For a different skewed shape, see the lognormal distribution calculator.
Assumptions and limits
- The shape and the rate or scale must be above 0.
- Values are 0 or more. Probabilities for a value search are between 0 and 1.
- Results use the exact distribution functions and not normal approximations.
- For a shape below 1 the density rises toward 0 and the mode is 0.
Frequently asked questions
What is the gamma distribution?
It is a distribution on positive numbers with a shape and a rate or scale. It describes waiting times and other skewed quantities.
What is the difference between rate and scale?
The scale is one divided by the rate. The page lets you enter either and shows both.
How is it related to the exponential distribution?
The exponential distribution is the gamma distribution with a shape of 1. A gamma with whole shape k is the sum of k independent exponential waiting times.
How do I find the 95th percentile?
Choose value for probability and enter 0.95. For shape 3 and rate 2 the answer is 3.1479.