Gamma distribution (source code)

= Gamma distribution
{wiki}

= Gamma distributed
{synonym}

The <Gamma distribution> with shape $a>0$ and rate $r>0$ has <probability density function>
$$
f(x)=\frac{r^a}{\Gamma(a)}x^{a-1}e^{-rx},\qquad x>0.
$$
The <gamma function> normalizes its <integral> to one. Its <mean> is $a/r$ and its <variance> is $a/r^2$, obtained by integrating powers of $x$. At $a=1$ it is the <exponential distribution>; <integer> $a$ gives the waiting time to the $a$th <event> of a rate-$r$ <Poisson process>. Independent gamma variables with the same rate add their shapes. Some sources use scale $1/r$ instead of rate, so the <parameter> convention must accompany the formula.