Gamma distribution
Story
The amount of time we have to wait for \(\alpha\) arrivals of a Poisson process. More concretely, if we have events, \(X_1, X_2, \ldots X_\alpha\) that are Exponentially distributed, \(X_1 + X_2 + \cdots X_\alpha\) is Gamma distributed. While this is the story for an integer number of arrivals, the Gamma distribution is defined for noninteger \(\alpha\) as well.
Example
Any multistep process where each step happens at the same rate. This is common in molecular rearrangements. For example, the time it takes for three phosphorylation events have to happen, assuming all phosphorylation events happen at the same rate, is Gamma distributed.
Parameters
The Gamma distribution has two parameter, both strictly positive. The shape parameter, corresponding to the number of arrivals of a Poisson process is \(\alpha\). The inverse scale parameter, corresponding to the rate of arrivals, is \(\beta\).
Support
The Gamma distribution is supported on the set of positive real numbers.
Probability density function
where \(\Gamma(\alpha)\) is the gamma function.
Cumulative distribution function
Moments
Mean: \(\displaystyle{\frac{\alpha}{\beta}}\)
Variance: \(\displaystyle{\frac{\alpha}{\beta^2}}\)
Usage
Package |
Syntax |
---|---|
NumPy |
|
SciPy |
|
Distributions.jl |
|
Stan |
|
Notes
The Gamma distribution is useful as a prior for positive parameters. It imparts a heavier tail than the Half-Normal distribution (but not too heavy; it keeps parameters from growing too large), and allows the parameter value to come close to zero.
The SciPy implementation has a location parameter, which should be set to zero, with \(1/\beta\) being the scale parameter.