What This Calculator Does
The Gamma Distribution Calculator computes the probability density function (PDF) and cumulative distribution function (CDF) of a gamma distribution at a chosen point X, using a shape parameter k and a scale parameter θ. Alongside the PDF and CDF, it also reports the distribution's mean, variance, mode, skewness and kurtosis, giving you a full statistical picture from three simple inputs. The gamma distribution is widely used to model waiting times, rainfall amounts, insurance claim sizes and other continuous, positive-valued quantities.
The Three Inputs
- Shape parameter (k): Controls the form of the curve. Small k gives a steeply decaying shape; larger k makes it more bell-like.
- Scale parameter (θ): Stretches the distribution along the x-axis. Larger θ spreads probability over higher values.
- X value: The point at which the density and cumulative probability are evaluated.
The Formula
The PDF used by the calculator is:
$$f(x) = \frac{x^{\,k-1}\,e^{-x/\theta}}{\theta^{k}\,\Gamma(k)}$$Here \(\Gamma(k)\) is the gamma function. The CDF is the integral of this density from 0 to X, computed via the regularised lower incomplete gamma function. The calculator also derives summary statistics directly from the parameters:
- Mean = \(k\cdot\theta\)
- Variance = \(k\cdot\theta^{2}\)
- Mode = \((k-1)\cdot\theta\) when \(k > 1\), otherwise 0
- Skewness = \(2/\sqrt{k}\)
- Kurtosis (excess) = \(6/k\)
Worked Example
Suppose k = 2, θ = 3 and X = 4. The PDF is $$f(4) = \frac{4^{1}\cdot e^{-4/3}}{3^{2}\cdot \Gamma(2)} = \frac{4 \cdot 0.2636}{9} \approx 0.117.$$ The CDF at X = 4 is about 0.385, meaning roughly a 38.5% chance the variable falls at or below 4. The mean is \(2 \times 3 = 6\), the variance is \(2 \times 3^{2} = 18\), the mode is \((2-1) \times 3 = 3\), the skewness is \(2/\sqrt{2} \approx 1.414\) and the excess kurtosis is \(6/2 = 3\).
Frequently Asked Questions
Is this scale or rate parameterisation? The calculator uses the scale form (θ). If you have a rate parameter β, convert it with \(\theta = 1/\beta\) before entering it.
What values are valid? Both k and θ must be positive, and X should be 0 or greater since the gamma distribution is defined only for non-negative values.
How does the gamma relate to the exponential and chi-squared? When k = 1 the gamma reduces to an exponential distribution with mean θ. A chi-squared distribution with v degrees of freedom is a gamma with \(k = v/2\) and \(\theta = 2\).