How it’s calculated
The gamma distribution models positive, right-skewed quantities such as waiting times, rainfall totals, insurance claim sizes and service times. With a whole-number shape k it is the waiting time until the k-th event of a Poisson process (the Erlang distribution); with k = 1 it is the exponential distribution, and the chi-square distribution with ν degrees of freedom is a gamma with k = ν/2 and θ = 2.
Books use two parameterizations. This page uses shape k and scale θ (NIST writes γ and β for these); if your source gives a shape α and a rate β, choose that option: the scale is θ = 1/β. Check which one you have, because the mean is kθ but α/β.
Worked example: shape k = 2 and scale θ = 3 (mean 6). For a whole-number shape the CDF has a closed form, F(5) = 1 − e^(−5/3)·(1 + 5/3) = 1 − 0.188876 × 2.666667 = 0.496332, and the pdf is 5·e^(−5/3)/9 = 0.104931. The variance is 2 × 9 = 18, so the standard deviation is 4.2426.
Frequently asked questions
Scale or rate: which do I have?
If the mean is shape × parameter, the parameter is a scale θ. If the mean is shape ÷ parameter, it is a rate β = 1/θ. Spreadsheet functions such as GAMMA.DIST use a scale; many statistics texts use a rate.
How is the gamma related to the exponential and chi-square?
Shape 1 gives the exponential distribution with mean θ. A chi-square with ν degrees of freedom is a gamma with shape ν/2 and scale 2. A sum of k independent exponentials with mean θ is gamma with shape k and scale θ.
How are the median and percentiles found?
There is no closed formula, so the calculator solves P(X ≤ x) = p by repeated halving (bisection) of an interval on the incomplete gamma function, to about 15 significant digits.
How do I estimate the shape and scale from data?
The method of moments gives k ≈ (mean ÷ standard deviation)² and θ ≈ variance ÷ mean. Maximum likelihood estimates are better but need software.
Embed this calculator
Add this free calculator to your own website. Copy the code below into your page’s HTML:
Need this calculator branded, changed or built around your own prices?See custom business solutions →
Sources
- NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.6.6.11 Gamma Distribution — NIST
- Probability, Mathematical Statistics, and Stochastic Processes (Siegrist), §5.8 The Gamma Distribution — LibreTexts
Formulas are taken from the free public references above. Results are provided “as is” for informational and educational purposes only. See our disclaimer.
Added · Last updated · How we check our calculators
Spotted a mistake or missing option? Report a problem· Suggest a calculator