Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Gamma distribution
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Probability distribution}} {{Infobox probability distribution 2 | name = Gamma | type = density | pdf_image = [[Image:Gammapdf252.svg|325px|Probability density plots of gamma distributions]] | cdf_image = [[Image:Gammacdf252.svg|325px|Cumulative distribution plots of gamma distributions]] | parameters = * {{math|''α'' > 0}} [[shape parameter|shape]] * {{math|''θ'' > 0}} [[scale parameter|scale]] | support = <math>x \in [0, \infty)</math> | pdf = <math>f(x)=\frac{1}{\Gamma(\alpha) \theta^\alpha} x^{\alpha - 1} e^{-x/\theta}</math> | cdf = <math>F(x)=\frac{1}{\Gamma(\alpha)} \gamma\left(\alpha, \frac{x}{\theta}\right)</math> | mean = <math>\alpha \theta </math> | median = No simple closed form | mode = <math>(\alpha - 1)\theta \text{ for } \alpha \geq 1</math>, <math>0 \text{ for } \alpha < 1</math> | variance = <math>\alpha \theta^2</math> | skewness = <math>\frac{2}{\sqrt{\alpha}}</math> | kurtosis = <math>\frac{6}{\alpha}</math> | entropy = <math>\begin{align} \alpha &+ \ln\theta + \ln\Gamma(\alpha)\\ &+ (1 - \alpha)\psi(\alpha) \end{align}</math> | mgf = <math>(1 - \theta t)^{-\alpha} \text{ for } t < \frac{1}{\theta}</math> | char = <math>(1 - \theta it)^{-\alpha}</math> | parameters2 = {{bulleted list | {{math|''α'' > 0}} [[shape parameter|shape]] | {{math|''λ'' > 0}} [[rate parameter|rate]] }} | support2 = <math>x \in (0, \infty)</math> | pdf2 = <math>f(x)=\frac{\lambda^\alpha}{\Gamma(\alpha)} x^{\alpha - 1} e^{-\lambda x }</math> | cdf2 = <math>F(x)=\frac{1}{\Gamma(\alpha)} \gamma(\alpha, \lambda x)</math> | mean2 = <math>\frac{\alpha}{\lambda}</math> | median2 = No simple closed form | mode2 = <math>\frac{\alpha - 1}{\lambda} \text{ for } \alpha \geq 1\text{, }0 \text{ for } \alpha < 1</math> | variance2 = <math>\frac{\alpha}{\lambda^2}</math> | skewness2 = <math>\frac{2}{\sqrt{\alpha}}</math> | kurtosis2 = <math>\frac{6}{\alpha}</math> | entropy2 = <math>\begin{align} \alpha &- \ln \lambda + \ln\Gamma(\alpha)\\ &+ (1 - \alpha)\psi(\alpha) \end{align}</math> | mgf2 = <math>\left(1 - \frac{t}{\lambda}\right)^{-\alpha} \text{ for } t < \lambda</math> | char2 = <math>\left(1 - \frac{it}{\lambda}\right)^{-\alpha}</math> | moments = <math> \alpha = \frac{E[X]^2}{V[X]}, </math> <math> \theta = \frac{V[X]}{E[X]} \quad \quad</math> | moments2 = <math> \alpha = \frac{E[X]^2}{V[X]}, </math> <math>\lambda = \frac{E[X]}{V[X]} </math> | fisher = <math>I(\alpha, \theta) = \begin{pmatrix}\psi^{(1)}(\alpha) & \theta^{-1} \\ \theta^{-1} & \alpha \theta^{-2}\end{pmatrix}</math> | fisher2 = <math>I(\alpha, \lambda) = \begin{pmatrix}\psi^{(1)}(\alpha) & -\lambda^{-1} \\ -\lambda^{-1} & \alpha \lambda^{-2}\end{pmatrix}</math> }} In [[probability theory]] and [[statistics]], the '''gamma distribution''' is a versatile two-[[statistical parameter|parameter]] family of continuous [[probability distribution]]s.<ref>{{Cite web |title=Gamma distribution {{!}} Probability, Statistics, Distribution {{!}} Britannica |url=https://www.britannica.com/science/gamma-distribution |access-date=2024-10-09 |website=www.britannica.com |language=en |archive-date=2024-05-19 |archive-url=https://web.archive.org/web/20240519084458/https://www.britannica.com/science/gamma-distribution |url-status=live }}</ref> The [[exponential distribution]], [[Erlang distribution]], and [[chi-squared distribution]] are special cases of the gamma distribution.<ref>{{Cite web |last=Weisstein |first=Eric W. |title=Gamma Distribution |url=https://mathworld.wolfram.com/GammaDistribution.html |access-date=2024-10-09 |website=mathworld.wolfram.com |language=en |archive-date=2024-05-28 |archive-url=https://web.archive.org/web/20240528053806/https://mathworld.wolfram.com/GammaDistribution.html |url-status=live }}</ref> There are two equivalent parameterizations in common use: # With a [[shape parameter]] {{mvar|α}} and a [[scale parameter]] {{mvar|θ}} # With a shape parameter <math>\alpha</math> and a [[rate parameter]] {{tmath|1=\lambda = 1/ \theta}} In each of these forms, both parameters are positive real numbers. The distribution has important applications in various fields, including [[econometrics]], [[Bayesian statistics]], and life testing.<ref>{{Cite web |title=Gamma Distribution {{!}} Gamma Function {{!}} Properties {{!}} PDF |url=https://www.probabilitycourse.com/chapter4/4_2_4_Gamma_distribution.php |access-date=2024-10-09 |website=www.probabilitycourse.com |archive-date=2024-06-13 |archive-url=https://web.archive.org/web/20240613044322/https://www.probabilitycourse.com/chapter4/4_2_4_Gamma_distribution.php |url-status=live }}</ref> In econometrics, the (''α'', ''θ'') parameterization is common for modeling waiting times, such as the time until death, where it often takes the form of an [[Erlang distribution]] for integer ''α'' values. Bayesian statisticians prefer the (''α'',''λ'') parameterization, utilizing the gamma distribution as a [[conjugate prior]] for several inverse scale parameters, facilitating analytical tractability in posterior distribution computations. The probability density and cumulative distribution functions of the gamma distribution vary based on the chosen parameterization, both offering insights into the behavior of gamma-distributed random variables. The gamma distribution is integral to modeling a range of phenomena due to its flexible shape, which can capture various statistical distributions, including the exponential and chi-squared distributions under specific conditions. Its mathematical properties, such as mean, variance, skewness, and higher moments, provide a toolset for statistical analysis and inference. Practical applications of the distribution span several disciplines, underscoring its importance in theoretical and applied statistics.<ref>{{Cite web |date=2019-03-11 |title=4.5: Exponential and Gamma Distributions |url=https://stats.libretexts.org/Courses/Saint_Mary's_College_Notre_Dame/MATH_345__-_Probability_(Kuter)/4:_Continuous_Random_Variables/4.5:_Exponential_and_Gamma_Distributions |access-date=2024-10-10 |website=Statistics LibreTexts |language=en}}</ref> The gamma distribution is the [[maximum entropy probability distribution]] (both with respect to a uniform base measure and a <math>1/x</math> base measure) for a random variable {{mvar|X}} for which {{math|1='''E'''[''X''] = ''αθ'' = ''α''/''λ''}} is fixed and greater than zero, and {{math|1='''E'''[ln ''X''] = ''ψ''(''α'') + ln ''θ'' = ''ψ''(''α'') − ln ''λ''}} is fixed ({{mvar|ψ}} is the [[digamma function]]).<ref>{{cite journal |last1=Park |first1=Sung Y. |last2=Bera |first2=Anil K. |year=2009 |title=Maximum entropy autoregressive conditional heteroskedasticity model |journal=Journal of Econometrics |volume=150 |issue=2 |pages=219–230 |url=http://www.wise.xmu.edu.cn/Master/Download/..%5C..%5CUploadFiles%5Cpaper-masterdownload%5C2009519932327055475115776.pdf |access-date=2011-06-02 |doi=10.1016/j.jeconom.2008.12.014 |citeseerx=10.1.1.511.9750 |archive-url=https://web.archive.org/web/20160307144515/http://wise.xmu.edu.cn/uploadfiles/paper-masterdownload/2009519932327055475115776.pdf |archive-date=2016-03-07 |url-status=dead }}</ref> == Definitions == The parameterization with {{mvar|α}} and {{mvar|θ}} appears to be more common in [[econometrics]] and other applied fields, where the gamma distribution is frequently used to model waiting times. For instance, in [[Accelerated life testing|life testing]], the waiting time until death is a [[random variable]] that is frequently modeled with a gamma distribution. See Hogg and Craig<ref>{{cite book |author-link=Robert V. Hogg |first1=R. V. |last1=Hogg |first2=A. T. |last2=Craig |year=1978 |title=Introduction to Mathematical Statistics |edition=4th |location=New York |publisher=Macmillan |isbn=0023557109|pages=Remark 3.3.1}}</ref> for an explicit motivation. The parameterization with {{mvar|α}} and {{mvar|λ}} is more common in [[Bayesian statistics]], where the gamma distribution is used as a [[conjugate prior]] distribution for various types of inverse scale (rate) parameters, such as the {{mvar|λ}} of an [[exponential distribution]] or a [[Poisson distribution]]<ref>{{Cite arXiv |eprint=1311.1704 |class=cs.IR |first1=Prem |last1=Gopalan |first2=Jake M. |last2=Hofman |title=Scalable Recommendation with Poisson Factorization |last3=Blei |first3=David M. |year=2013 |author3-link=David Blei}}</ref> – or for that matter, the {{mvar|λ}} of the gamma distribution itself. The closely related [[inverse-gamma distribution]] is used as a conjugate prior for scale parameters, such as the [[variance]] of a [[normal distribution]]. If {{mvar|α}} is a positive [[integer]], then the distribution represents an [[Erlang distribution]]; i.e., the sum of {{mvar|α}} independent [[exponentially distributed]] [[random variable]]s, each of which has a mean of {{mvar|θ}}. === Characterization using shape ''α'' and rate ''λ'' === The gamma distribution can be parameterized in terms of a [[shape parameter]] {{math|1=''α''}} and an inverse scale parameter {{math|1=''λ'' = 1/''θ''}}, called a [[rate parameter]]. A random variable {{mvar|X}} that is gamma-distributed with shape {{mvar|α}} and rate {{mvar|λ}} is denoted <math display=block>X \sim \Gamma(\alpha, \lambda) \equiv \operatorname{Gamma}(\alpha,\lambda)</math> The corresponding probability density function in the shape-rate parameterization is <math display=block> \begin{align} f(x;\alpha,\lambda) & = \frac{ x^{\alpha-1} e^{-\lambda x} \lambda^\alpha}{\Gamma(\alpha)} \quad \text{ for } x > 0 \quad \alpha, \lambda > 0, \\[6pt] \end{align} </math> where <math>\Gamma(\alpha)</math> is the [[gamma function]]. For all positive integers, <math>\Gamma(\alpha)=(\alpha-1)!</math>. The [[cumulative distribution function]] is the regularized gamma function: <math display=block> F(x;\alpha,\lambda) = \int_0^x f(u;\alpha,\lambda)\,du= \frac{\gamma(\alpha, \lambda x)}{\Gamma(\alpha)},</math> where <math>\gamma(\alpha, \lambda x)</math> is the lower [[incomplete gamma function]]. If {{mvar|α}} is a positive [[integer]] (i.e., the distribution is an [[Erlang distribution]]), the cumulative distribution function has the following series expansion:<ref name="Papoulis"/> <math display=block>F(x;\alpha,\lambda) = 1-\sum_{i=0}^{\alpha-1} \frac{(\lambda x)^i}{i!} e^{-\lambda x} = e^{-\lambda x} \sum_{i=\alpha}^\infty \frac{(\lambda x)^i}{i!}.</math> === Characterization using shape ''α'' and scale ''θ'' === A random variable {{mvar|X}} that is gamma-distributed with shape {{mvar|α}} and scale {{mvar|θ}} is denoted by <math display=block>X \sim \Gamma(\alpha, \theta) \equiv \operatorname{Gamma}(\alpha, \theta)</math> [[Image:Gamma-PDF-3D.png|thumb|right|320px|Illustration of the gamma PDF for parameter values over {{mvar|α}} and {{mvar|x}} with {{mvar|θ}} set to {{math|1, 2, 3, 4, 5,}} and {{math|6}}. One can see each {{mvar|θ}} layer by itself here [http://commons.wikimedia.org/wiki/File:Gamma-PDF-3D-by-k.png] as well as by {{mvar|α}} [http://commons.wikimedia.org/wiki/File:Gamma-PDF-3D-by-Theta.png] and {{mvar|x}}. [http://commons.wikimedia.org/wiki/File:Gamma-PDF-3D-by-x.png].]] The [[probability density function]] using the shape-scale parametrization is <math display=block>f(x;\alpha,\theta) = \frac{x^{\alpha-1}e^{-x/\theta}}{\theta^\alpha\Gamma(\alpha)} \quad \text{ for } x > 0 \text{ and } \alpha, \theta > 0.</math> Here {{math|Γ(''α'')}} is the [[gamma function]] evaluated at {{mvar|α}}. The [[cumulative distribution function]] is the regularized gamma function: <math display=block> F(x;\alpha,\theta) = \int_0^x f(u;\alpha,\theta)\,du = \frac{\gamma\left(\alpha, \frac{x}{\theta}\right)}{\Gamma(\alpha)},</math> where <math>\gamma\left(\alpha, \frac{x}{\theta}\right)</math> is the lower [[incomplete gamma function]]. It can also be expressed as follows, if {{mvar|α}} is a positive [[integer]] (i.e., the distribution is an [[Erlang distribution]]):<ref name="Papoulis">Papoulis, Pillai, ''Probability, Random Variables, and Stochastic Processes'', Fourth Edition</ref> <math display=block>F(x;\alpha,\theta) = 1-\sum_{i=0}^{\alpha-1} \frac{1}{i!} \left(\frac{x}{\theta} \right)^i e^{-x/\theta} = e^{-x/\theta} \sum_{i=\alpha}^\infty \frac{1}{i!} \left( \frac{x}{\theta} \right)^i.</math> Both parametrizations are common because either can be more convenient depending on the situation. == Properties == === Mean and variance === The mean of gamma distribution is given by the product of its shape and scale parameters: <math display=block>\mu = \alpha\theta = \alpha/\lambda</math> The variance is: <math display=block>\sigma^2 = \alpha \theta^2 = \alpha/\lambda^2</math> The square root of the inverse shape parameter gives the [[coefficient of variation]]: <math display=block>\sigma/\mu = \alpha^{-0.5} = 1/\sqrt{\alpha}</math> === Skewness === The [[skewness]] of the gamma distribution only depends on its shape parameter, {{mvar|α}}, and it is equal to <math>2/\sqrt{\alpha}.</math> === Higher moments === The {{mvar|n}}-th [[raw moment]] is given by: <math display=block> \mathrm{E}[X^n] = \theta^n \frac{\Gamma(\alpha+n)}{\Gamma(\alpha)} = \theta^n \prod_{i=1}^n(\alpha+i-1) \; \text{ for } n=1, 2, \ldots. </math> ===Median approximations and bounds=== [[File:Gamma distribution median bounds.png|thumb|320px|Bounds and asymptotic approximations to the median of the gamma distribution. The cyan-colored region indicates the large gap between published lower and upper bounds before 2021.]] Unlike the mode and the mean, which have readily calculable formulas based on the parameters, the median does not have a closed-form equation. The median for this distribution is the value <math>\nu</math> such that <math display=block>\frac{1}{\Gamma(\alpha) \theta^\alpha} \int_0^{\nu} x^{\alpha - 1} e^{-x/\theta} dx = \frac{1}{2}.</math> A rigorous treatment of the problem of determining an asymptotic expansion and bounds for the median of the gamma distribution was handled first by Chen and Rubin, who proved that (for <math>\theta = 1</math>) <math display=block> \alpha - \frac{1}{3} < \nu(\alpha) < \alpha, </math> where <math>\mu(\alpha) = \alpha</math> is the mean and <math>\nu(\alpha)</math> is the median of the <math>\text{Gamma}(\alpha,1)</math> distribution.<ref>Jeesen Chen, [[Herman Rubin]], Bounds for the difference between median and mean of gamma and Poisson distributions, Statistics & Probability Letters, Volume 4, Issue 6, October 1986, Pages 281–283, {{issn|0167-7152}}, [https://dx.doi.org/10.1016/0167-7152(86)90044-1] {{Webarchive|url=https://web.archive.org/web/20241009203229/https://www.sciencedirect.com/unsupported_browser|date=2024-10-09}}.</ref> For other values of the scale parameter, the mean scales to <math>\mu = \alpha\theta</math>, and the median bounds and approximations would be similarly scaled by {{mvar|θ}}. K. P. Choi found the first five terms in a [[Laurent series]] asymptotic approximation of the median by comparing the median to [[Ramanujan theta function|Ramanujan's <math> \theta </math> function]].<ref>Choi, K. P. [https://www.ams.org/journals/proc/1994-121-01/S0002-9939-1994-1195477-8/S0002-9939-1994-1195477-8.pdf "On the Medians of the Gamma Distributions and an Equation of Ramanujan"] {{Webarchive|url=https://web.archive.org/web/20210123121523/https://www.ams.org/journals/proc/1994-121-01/S0002-9939-1994-1195477-8/S0002-9939-1994-1195477-8.pdf |date=2021-01-23 }}, Proceedings of the American Mathematical Society, Vol. 121, No. 1 (May, 1994), pp. 245–251.</ref> Berg and Pedersen found more terms:<ref name="Pedersen, Henrik L.-2006">{{cite journal |author=Berg, Christian |author2=Pedersen, Henrik L. |name-list-style=amp |title=The Chen–Rubin conjecture in a continuous setting |journal=Methods and Applications of Analysis |date=March 2006 |volume=13 |issue=1 |pages=63–88 |doi=10.4310/MAA.2006.v13.n1.a4 |s2cid=6704865 |url=https://www.intlpress.com/site/pub/files/_fulltext/journals/maa/2006/0013/0001/MAA-2006-0013-0001-a004.pdf |access-date=1 April 2020 |doi-access=free |archive-date=16 January 2021 |archive-url=https://web.archive.org/web/20210116114105/https://www.intlpress.com/site/pub/files/_fulltext/journals/maa/2006/0013/0001/MAA-2006-0013-0001-a004.pdf |url-status=live }}</ref> <math display=block> \nu(\alpha) = \alpha - \frac{1}{3} + \frac{8}{405\alpha} + \frac{184}{25515 \alpha^2} + \frac{2248}{3444525 \alpha^3} - \frac{19006408}{15345358875 \alpha^4} - O\left(\frac{1}{\alpha^5}\right) + \cdots </math> [[File:Gamma distribution median Lyon bounds.png|320px|thumb| Two gamma distribution median asymptotes which were proved in 2023 to be bounds (upper solid red and lower dashed red), of the from <math>\nu(\alpha) \approx 2^{-1/\alpha}(A + \alpha)</math>, and an interpolation between them that makes an approximation (dotted red) that is exact at {{math|1=''α'' = 1}} and has maximum relative error of about 0.6%. The cyan shaded region is the remaining gap between upper and lower bounds (or conjectured bounds), including these new bounds and the bounds in the previous figure.]] [[File:Gamma distribution median loglog bounds.png|thumb|320px|[[Log–log plot]] of upper (solid) and lower (dashed) bounds to the median of a gamma distribution and the gaps between them. The green, yellow, and cyan regions represent the gap before the Lyon 2021 paper. The green and yellow narrow that gap with the lower bounds that Lyon proved. Lyon's bounds proved in 2023 further narrow the yellow. Mostly within the yellow, closed-form rational-function-interpolated conjectured bounds are plotted along with the numerically calculated median (dotted) value. Tighter interpolated bounds exist but are not plotted, as they would not be resolved at this scale.]] Partial sums of these series are good approximations for high enough {{mvar|α}}; they are not plotted in the figure, which is focused on the low-{{mvar|α}} region that is less well approximated. Berg and Pedersen also proved many properties of the median, showing that it is a convex function of {{mvar|α}},<ref name="Berg">Berg, Christian and Pedersen, Henrik L. [https://arxiv.org/abs/math/0609442 "Convexity of the median in the gamma distribution"] {{Webarchive|url=https://web.archive.org/web/20230526181721/https://arxiv.org/abs/math/0609442 |date=2023-05-26 }}.</ref> and that the asymptotic behavior near <math>\alpha = 0</math> is <math>\nu(\alpha) \approx e^{-\gamma}2^{-1/\alpha}</math> (where {{mvar|γ}} is the [[Euler–Mascheroni constant]]), and that for all <math>\alpha > 0</math> the median is bounded by <math>\alpha 2^{-1/\alpha} < \nu(\alpha) < k e^{-1/3k}</math>.<ref name="Pedersen, Henrik L.-2006"/> A closer linear upper bound, for <math>\alpha \ge 1</math> only, was provided in 2021 by Gaunt and Merkle,<ref>{{cite journal |last1=Gaunt, Robert E., and Milan Merkle |title=On bounds for the mode and median of the generalized hyperbolic and related distributions |journal=Journal of Mathematical Analysis and Applications |date=2021 |volume=493 |issue=1 |pages=124508|doi=10.1016/j.jmaa.2020.124508 |arxiv=2002.01884 |s2cid=221103640 }}</ref> relying on the Berg and Pedersen result that the slope of <math>\nu(\alpha)</math> is everywhere less than 1: <math display=block> \nu(\alpha) \le \alpha - 1 + \log2 ~~</math> for <math>\alpha \ge 1</math> (with equality at <math>\alpha = 1</math>) which can be extended to a bound for all <math>\alpha > 0</math> by taking the max with the chord shown in the figure, since the median was proved convex.<ref name="Berg"/> An approximation to the median that is asymptotically accurate at high {{mvar|α}} and reasonable down to <math>\alpha = 0.5</math> or a bit lower follows from the [[Wilson–Hilferty transformation]]: <math display=block> \nu(\alpha) = \alpha \left( 1 - \frac{1}{9\alpha} \right)^3 </math> which goes negative for <math>\alpha < 1/9</math>. In 2021, Lyon proposed several approximations of the form <math>\nu(\alpha) \approx 2^{-1/\alpha}(A + B\alpha)</math>. He conjectured values of {{mvar|A}} and {{mvar|B}} for which this approximation is an asymptotically tight upper or lower bound for all <math>\alpha > 0</math>.<ref name="Lyon-2021a">{{cite journal |last1=Lyon |first1=Richard F. |title=On closed-form tight bounds and approximations for the median of a gamma distribution |journal=[[PLOS One]] |date=13 May 2021 |volume=16 |issue=5 |pages=e0251626 |doi=10.1371/journal.pone.0251626 |pmid=33984053 |pmc=8118309 |arxiv=2011.04060 |bibcode=2021PLoSO..1651626L |doi-access=free }}</ref> In particular, he proposed these closed-form bounds, which he proved in 2023:<ref name="Lyon-2021b">{{cite journal |last1=Lyon |first1=Richard F. |title=Tight bounds for the median of a gamma distribution |journal=[[PLOS One]] |date=13 May 2021 |volume=18 |issue=9 |pages=e0288601 |doi=10.1371/journal.pone.0288601 |pmid=37682854 |pmc=10490949 |doi-access=free }}</ref> <math display=block> \nu_{L\infty}(\alpha) = 2^{-1/\alpha}(\log 2 - \frac{1}{3} + \alpha) \quad</math> is a lower bound, asymptotically tight as <math>\alpha \to \infty</math> <math display=block> \nu_U(\alpha) = 2^{-1/\alpha}(e^{-\gamma} + \alpha) \quad</math> is an upper bound, asymptotically tight as <math>\alpha \to 0</math> Lyon also showed (informally in 2021, rigorously in 2023) two other lower bounds that are not [[closed-form expression]]s, including this one involving the [[gamma function]], based on solving the integral expression substituting 1 for <math>e^{-x}</math>: <math display=block>\nu(\alpha) > \left( \frac{2}{\Gamma(\alpha+1)} \right)^{-1/\alpha} \quad</math> (approaching equality as <math>k \to 0</math>) and the tangent line at <math>\alpha = 1</math> where the derivative was found to be <math>\nu^\prime(1) \approx 0.9680448</math>: <math display=block>\nu(\alpha) \ge \nu(1) + (\alpha-1) \nu^\prime(1) \quad</math> (with equality at <math>k = 1</math>) <math display=block>\nu(\alpha) \ge \log 2 + (\alpha-1) (\gamma - 2 \operatorname{Ei}(-\log 2) - \log \log 2)</math> where Ei is the [[exponential integral]].<ref name="Lyon-2021a"/><ref name="Lyon-2021b"/> Additionally, he showed that interpolations between bounds could provide excellent approximations or tighter bounds to the median, including an approximation that is exact at <math>\alpha = 1</math> (where <math>\nu(1) = \log 2</math>) and has a maximum relative error less than 0.6%. Interpolated approximations and bounds are all of the form <math display=block>\nu(\alpha) \approx \tilde{g}(\alpha)\nu_{L\infty}(\alpha) + (1 - \tilde{g}(\alpha)) \nu_U(\alpha)</math> where <math>\tilde{g}</math> is an interpolating function running monotonially from 0 at low {{mvar|α}} to 1 at high {{mvar|α}}, approximating an ideal, or exact, interpolator <math>g(\alpha)</math>: <math display=block>g(\alpha) = \frac{\nu_U(\alpha) - \nu(\alpha)}{\nu_U(\alpha) - \nu_{L\infty}(\alpha)}</math> For the simplest interpolating function considered, a first-order rational function <math display=block>\tilde{g}_1(\alpha) = \frac{\alpha}{b_0 + \alpha}</math> the tightest lower bound has <math display=block>b_0 = \frac{\frac{8}{405} + e^{-\gamma} \log 2 - \frac{\log^2 2}{2}}{e^{-\gamma} - \log 2 + \frac{1}{3}} - \log 2 \approx 0.143472</math> and the tightest upper bound has <math display=block>b_0 = \frac{e^{-\gamma} - \log 2 + \frac{1}{3}}{1 - \frac{e^{-\gamma} \pi^2}{12}} \approx 0.374654</math> The interpolated bounds are plotted (mostly inside the yellow region) in the [[log–log plot]] shown. Even tighter bounds are available using different interpolating functions, but not usually with closed-form parameters like these.<ref name="Lyon-2021a"/> ===Summation=== If {{math|''X''<sub>''i''</sub>}} has a {{math|Gamma(''α''<sub>''i''</sub>, ''θ'')}} distribution for {{math|1=''i'' = 1, 2, ..., ''N''}} (i.e., all distributions have the same scale parameter {{mvar|θ}}), then <math display=block> \sum_{i=1}^N X_i \sim\mathrm{Gamma} \left( \sum_{i=1}^N \alpha_i, \theta \right)</math> provided all {{math|''X''<sub>''i''</sub>}} are [[statistical independence|independent]]. For the cases where the {{math|''X''<sub>''i''</sub>}} are [[statistical independence|independent]] but have different scale parameters, see Mathai <ref>{{Cite journal|last=Mathai|first=A. M.|title=Storage capacity of a dam with gamma type inputs|journal=Annals of the Institute of Statistical Mathematics|language=en|volume=34|issue=3|pages=591–597|doi=10.1007/BF02481056|issn=0020-3157|year=1982|s2cid=122537756}}</ref> or Moschopoulos.<ref>{{cite journal |first=P. G. |last=Moschopoulos |year=1985 |title=The distribution of the sum of independent gamma random variables |journal=Annals of the Institute of Statistical Mathematics |volume=37 |issue=3 |pages=541–544 |doi=10.1007/BF02481123 |s2cid=120066454 }}</ref> The gamma distribution exhibits [[Infinite divisibility (probability)|infinite divisibility]]. ===Scaling=== If <math display=block>X \sim \mathrm{Gamma}(\alpha, \theta),</math> then, for any {{math|''c'' > 0}}, <math display=block>cX \sim \mathrm{Gamma}(\alpha, c\,\theta),</math> by moment generating functions, or equivalently, if <math display=block>X \sim \mathrm{Gamma}\left( \alpha,\lambda \right)</math> (shape-rate parameterization) <math display=block>cX \sim \mathrm{Gamma}\left( \alpha, \frac \lambda c \right),</math> Indeed, we know that if {{mvar|X}} is an [[exponential distribution|exponential r.v.]] with rate {{mvar|λ}}, then {{math|''cX''}} is an exponential r.v. with rate {{math|''λ''/''c''}}; the same thing is valid with Gamma variates (and this can be checked using the [[moment-generating function]], see, e.g.,[http://www.stat.washington.edu/thompson/S341_10/Notes/week4.pdf these notes], 10.4-(ii)): multiplication by a positive constant {{mvar|c}} divides the rate (or, equivalently, multiplies the scale). ===Exponential family=== The gamma distribution is a two-parameter [[exponential family]] with [[natural parameters]] {{math|''α'' − 1}} and {{math|−1/''θ''}} (equivalently, {{math|''α'' − 1}} and {{math|−''λ''}}), and [[natural statistics]] {{mvar|X}} and {{math|ln ''X''}}. If the shape parameter {{mvar|α}} is held fixed, the resulting one-parameter family of distributions is a [[natural exponential family]]. ===Logarithmic expectation and variance=== One can show that <math display=block>\operatorname{E}[\ln X] = \psi(\alpha) - \ln \lambda</math> or equivalently, <math display=block>\operatorname{E}[\ln X] = \psi(\alpha) + \ln \theta</math> where {{mvar|ψ}} is the [[digamma function]]. Likewise, <math display="block">\operatorname{var}[\ln X] = \psi^{(1)}(\alpha)</math> where <math>\psi^{(1)}</math> is the [[trigamma function]]. This can be derived using the [[exponential family]] formula for the [[exponential family#Moment generating function of the sufficient statistic|moment generating function of the sufficient statistic]], because one of the sufficient statistics of the gamma distribution is {{math|ln ''x''}}. ===Information entropy=== The [[information entropy]] is <math display=block> \begin{align} \operatorname{H}(X) & = \operatorname{E}[-\ln p(X)] \\[4pt] & = \operatorname{E}[-\alpha \ln \lambda + \ln \Gamma(\alpha) - (\alpha-1)\ln X + \lambda X] \\[4pt] & = \alpha - \ln \lambda + \ln \Gamma(\alpha) + (1-\alpha)\psi(\alpha). \end{align} </math> In the {{mvar|α}}, {{mvar|θ}} parameterization, the [[information entropy]] is given by <math display=block>\operatorname{H}(X) =\alpha + \ln \theta + \ln \Gamma(\alpha) + (1-\alpha)\psi(\alpha).</math> ===Kullback–Leibler divergence=== [[Image:Gamma-KL-3D.png|thumb|right|320px|Illustration of the Kullback–Leibler (KL) divergence for two gamma PDFs. Here {{math|1=''λ'' = ''λ''<sub>0</sub> + 1}} which are set to {{math|1, 2, 3, 4, 5,}} and {{math|6}}. The typical asymmetry for the KL divergence is clearly visible.]] The [[Kullback–Leibler divergence]] (KL-divergence), of {{math|Gamma(''α''<sub>''p''</sub>, ''λ''<sub>''p''</sub>)}} ("true" distribution) from {{math|Gamma(''α''<sub>''q''</sub>, ''λ''<sub>''q''</sub>)}} ("approximating" distribution) is given by<ref>{{cite web|first=W. D.|last=Penny|url=https://www.fil.ion.ucl.ac.uk/~wpenny/publications/densities.ps|title= KL-Divergences of Normal, Gamma, Dirichlet, and Wishart densities}}</ref> <math display=block> \begin{align} D_{\mathrm{KL}}(\alpha_p,\lambda_p; \alpha_q, \lambda_q) = {} & (\alpha_p-\alpha_q) \psi(\alpha_p) - \log\Gamma(\alpha_p) + \log\Gamma(\alpha_q) \\ & {} + \alpha_q(\log \lambda_p - \log \lambda_q) + \alpha_p\frac{\lambda_q-\lambda_p}{\lambda_p}. \end{align} </math> Written using the {{mvar|α}}, {{mvar|θ}} parameterization, the KL-divergence of {{math|Gamma(''α''<sub>''p''</sub>, ''θ''<sub>''p''</sub>)}} from {{math|Gamma(''α''<sub>''q''</sub>, ''θ''<sub>''q''</sub>)}} is given by <math display=block> \begin{align} D_{\mathrm{KL}}(\alpha_p,\theta_p; \alpha_q, \theta_q) = {} & (\alpha_p-\alpha_q)\psi(\alpha_p) - \log\Gamma(\alpha_p) + \log\Gamma(\alpha_q) \\ & {} + \alpha_q(\log \theta_q - \log \theta_p) + \alpha_p \frac{\theta_p - \theta_q}{\theta_q}. \end{align} </math> ===Laplace transform=== The [[Laplace transform]] of the gamma PDF, which is the [[moment-generating function]] of the gamma distribution, is <math display="block">F(s) = \operatorname E\left( e^{sX} \right) = \frac1 {(1 - \theta s)^\alpha} = \left( \frac\lambda{ \lambda - s} \right)^\alpha </math> (where <math display=inline>X</math> is a random variable with that distribution). ==Related distributions== ===General=== * Let <math> X_1, X_2, \ldots, X_n </math> be <math> n </math> independent and identically distributed random variables following an [[exponential distribution]] with rate parameter ''λ'', then <math>\sum_i X_i \sim \operatorname{Gamma}(n,\lambda)</math> where ''n'' is the shape parameter and {{mvar|λ}} is the rate, and <math display=inline>\bar{X} = \frac{1}{n} \sum_i X_i \sim \operatorname{Gamma}(n, n\lambda)</math>. * If {{math|''X'' ~ Gamma(1, ''λ'')}} (in the shape–rate parametrization), then {{mvar|X}} has an [[exponential distribution]] with rate parameter {{mvar|λ}}. In the shape-scale parametrization, {{math|''X'' ~ Gamma(1, ''θ'')}} has an exponential distribution with rate parameter {{math|1/''θ''}}. * If {{math|''X'' ~ Gamma(''ν''/2, 2)}} (in the shape–scale parametrization), then {{mvar|X}} is identical to {{math|''χ''<sup>2</sup>(''ν'')}}, the [[chi-squared distribution]] with {{mvar|ν}} degrees of freedom. Conversely, if {{math|''Q'' ~ ''χ''<sup>2</sup>(''ν'')}} and {{mvar|c}} is a positive constant, then {{math|''cQ'' ~ Gamma(''ν''/2, 2''c'')}}. * If {{math|1=''θ'' = 1/''α''}}, one obtains the [[Schulz-Zimm distribution]], which is most prominently used to model polymer chain lengths. * If {{mvar|α}} is an [[integer]], the gamma distribution is an [[Erlang distribution]] and is the probability distribution of the waiting time until the {{mvar|α}}-th "arrival" in a one-dimensional [[Poisson process]] with intensity {{math|1/''θ''}}. If ::<math>X \sim \Gamma(\alpha \in \mathbf{Z}, \theta), \qquad Y \sim \operatorname{Pois}\left(\frac x \theta \right),</math> :then ::<math>P(X > x) = P(Y < \alpha).</math> * If {{mvar|X}} has a [[Maxwell–Boltzmann distribution]] with parameter {{mvar|a}}, then ::<math>X^2 \sim \Gamma\left(\frac{3}{2}, 2a^2\right).</math> <!-- * <math>Y \sim N(\mu = \alpha \lambda, \sigma^2 = \alpha \lambda^2)</math> is a [[normal distribution]] as <math>Y = \lim_{\alpha \to \infty} X</math> where {{math|''X'' ~ Gamma(''α'', ''λ'')}}. --> * If {{math|''X'' ~ Gamma(''α'', ''θ'')}}, then <math display=inline>\log X</math> follows an exponential-gamma (abbreviated exp-gamma) distribution.<ref>{{Cite web|url=https://reference.wolfram.com/language/ref/ExpGammaDistribution.html|title = ExpGammaDistribution—Wolfram Language Documentation}}</ref> It is sometimes referred to as the log-gamma distribution.<ref>{{Cite web|url=https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.loggamma.html#scipy.stats.loggamma|title=scipy.stats.loggamma — SciPy v1.8.0 Manual|website=docs.scipy.org}}</ref> Formulas for its mean and variance are in the section [[#Logarithmic expectation and variance]]. * If {{math|''X'' ~ Gamma(''α'', ''θ'')}}, then <math>\sqrt{X}</math> follows a [[generalized gamma distribution]] with parameters {{math|1=''p'' = 2}}, {{math|1=''d'' = 2''α''}}, and <math>a = \sqrt{\theta}</math> {{citation needed|date=September 2012}}. * More generally, if {{math|''X'' ~ Gamma(''α'',''θ'')}}, then <math>X^q</math> for <math>q > 0</math> follows a [[generalized gamma distribution]] with parameters {{math|1=''p'' = 1/''q''}}, {{math|1=''d'' = ''α''/''q''}}, and <math>a = \theta^q</math>. * If {{math|''X'' ~ Gamma(''α'', ''θ'')}} with shape {{mvar|α}} and scale {{mvar|θ}}, then {{math|1/''X'' ~ Inv-Gamma(''α'', ''θ''<sup>−1</sup>)}} (see [[Inverse-gamma distribution]] for derivation). * Parametrization 1: If <math>X_k \sim \Gamma(\alpha_k,\theta_k)\,</math> are independent, then <math> \frac{\alpha_2\theta_2 X_1}{\alpha_1\theta_1 X_2} \sim \mathrm{F}(2\alpha_1, 2\alpha_2)</math>, or equivalently, <math>\frac{X_1}{X_2} \sim \lambda'\left(\alpha_1, \alpha_2, 1, \frac{\theta_1}{\theta_2}\right)</math> * Parametrization 2: If <math>X_k \sim \Gamma(\alpha_k,\lambda_k)\,</math> are independent, then <math> \frac{\alpha_2\lambda_1 X_1}{\alpha_1\lambda_2 X_2} \sim \mathrm{F}(2\alpha_1, 2\alpha_2)</math>, or equivalently, <math>\frac{X_1}{X_2} \sim \lambda'\left(\alpha_1, \alpha_2, 1, \frac{\lambda_2}{\lambda_1}\right)</math> * If {{math|''X'' ~ Gamma(''α'', ''θ'')}} and {{math|''Y'' ~ Gamma(''λ'', ''θ'')}} are independently distributed, then {{math|''X''/(''X'' + ''Y'')}} has a [[beta distribution]] with parameters {{mvar|α}} and {{mvar|λ}}, and {{math|''X''/(''X'' + ''Y'')}} is independent of {{math|''X'' + ''Y''}}, which is {{math|Gamma(''α'' + ''λ'', ''θ'')}}-distributed. * If <math>X_n \sim \text{Beta}(\alpha,n\lambda)\,</math> and <math>Y_n = nX_n</math>, then <math>Y_n</math> converges in distribution to <math>\text{Gamma}(\alpha,\lambda)</math> defined under parametrization 2. * If {{math|''X''<sub>''i''</sub> ~ Gamma(''α''<sub>''i''</sub>, 1)}} are independently distributed, then the vector ({{math|''X''<sub>1</sub>/''S'', ..., ''X''<sub>''n''</sub>/''S'')}}, where {{math|1=''S'' = ''X''<sub>1</sub> + ... + ''X''<sub>''n''</sub>}}, follows a [[Dirichlet distribution]] with parameters {{math|''α''<sub>1</sub>, ..., ''α''<sub>''n''</sub>}}. * For large {{mvar|α}} the gamma distribution converges to [[normal distribution]] with mean {{math|1=''μ'' = ''αθ''}} and variance {{math|1=''σ''<sup>2</sup> = ''αθ''<sup>2</sup>}}. * The gamma distribution is the [[conjugate prior]] for the precision of the [[normal distribution]] with known [[mean]]. * The [[matrix gamma distribution]] and the [[Wishart distribution]] are multivariate generalizations of the gamma distribution (samples are positive-definite matrices rather than positive real numbers). * The gamma distribution is a special case of the [[generalized gamma distribution]], the [[generalized integer gamma distribution]], and the [[generalized inverse Gaussian distribution]]. * Among the discrete distributions, the [[negative binomial distribution]] is sometimes considered the discrete analog of the gamma distribution. * [[Tweedie distribution]]s – the gamma distribution is a member of the family of Tweedie [[exponential dispersion model]]s. * Modified [[Half-normal distribution]] – the Gamma distribution is a member of the family of [[Modified half-normal distribution]].<ref>{{cite journal |last1=Sun |first1=Jingchao |last2=Kong |first2=Maiying |last3=Pal |first3=Subhadip |title=The Modified-Half-Normal distribution: Properties and an efficient sampling scheme |journal=Communications in Statistics - Theory and Methods |date=22 June 2021 |volume=52 |issue=5 |pages=1591–1613 |doi=10.1080/03610926.2021.1934700 |s2cid=237919587 |url=https://figshare.com/articles/journal_contribution/The_Modified-Half-Normal_distribution_Properties_and_an_efficient_sampling_scheme/14825266/1/files/28535884.pdf |issn=0361-0926 |access-date=2 September 2022 |archive-date= |archive-url= |url-status= }}</ref> The corresponding density is <math> f(x\mid \alpha, \lambda, \gamma)= \frac{2\lambda^{\frac{\alpha}{2}} x^{\alpha-1} \exp(-\lambda x^2+ \gamma x )}{\Psi{\left(\frac{\alpha}{2}, \frac{ \gamma}{\sqrt{\lambda}}\right)}}</math>, where <math>\Psi(\alpha,z)={}_1\Psi_1\left(\begin{matrix}\left(\alpha,\frac{1}{2}\right)\\(1,0)\end{matrix};z \right)</math> denotes the [[Fox–Wright Psi function]]. * For the shape-scale parameterization <math>x|\theta \sim \Gamma(\alpha,\theta)</math>, if the scale parameter <math>\theta \sim IG(b,1)</math> where <math>IG</math> denotes the [[Inverse-gamma distribution]], then the marginal distribution <math>x \sim \lambda'(\alpha,b)</math> where <math>\lambda'</math> denotes the [[Beta prime distribution]]. ===Compound gamma=== If the shape parameter of the gamma distribution is known, but the inverse-scale parameter is unknown, then a gamma distribution for the inverse scale forms a conjugate prior. The [[compound distribution]], which results from integrating out the inverse scale, has a closed-form solution known as the [[compound gamma distribution]].<ref name="Dubey-1970">{{cite journal|last=Dubey|first=Satya D. | title=Compound gamma, beta and F distributions|journal=Metrika|date=December 1970|volume=16|issue=1 |pages=27–31 |doi=10.1007/BF02613934|s2cid=123366328 }}</ref> If, instead, the shape parameter is known but the mean is unknown, with the prior of the mean being given by another gamma distribution, then it results in [[K-distribution]]. ===Weibull and stable count=== The gamma distribution <math> f(x;\alpha) \, (\alpha > 1) </math> can be expressed as the product distribution of a [[Weibull distribution]] and a variant form of the [[stable count distribution]]. Its shape parameter <math> \alpha </math> can be regarded as the inverse of Lévy's stability parameter in the stable count distribution: <math display="block"> f(x;\alpha) = \int_0^\infty \frac{1}{u} \, W_k\left(\frac{x}{u}\right) \left[ k u^{\alpha-1} \, \mathfrak{N}_{\frac{1}{\alpha}}\left(u^\alpha\right) \right] \, du , </math> where <math>\mathfrak{N}_\alpha(\nu)</math> is a standard stable count distribution of shape <math> \alpha </math>, and <math>W_\alpha(x)</math> is a standard Weibull distribution of shape <math> \alpha </math>. ==Statistical inference== ===Parameter estimation=== ====Maximum likelihood estimation==== The likelihood function for {{mvar|N}} [[iid]] observations {{math|(''x''<sub>1</sub>, ..., ''x''<sub>''N''</sub>)}} is <math display=block>L(\alpha, \theta) = \prod_{i=1}^N f(x_i;\alpha,\theta)</math> from which we calculate the log-likelihood function <math display=block>\ell(\alpha, \theta) = (\alpha - 1) \sum_{i=1}^N \ln x_i - \sum_{i=1}^N \frac{x_i} \theta - N\alpha\ln \theta - N\ln \Gamma(\alpha)</math> Finding the maximum with respect to {{mvar|θ}} by taking the derivative and setting it equal to zero yields the [[maximum likelihood]] estimator of the {{mvar|θ}} parameter, which equals the [[sample mean]] <math>\bar{x}</math> divided by the shape parameter {{mvar|α}}: <math display=block>\hat{\theta} = \frac{1}{\alpha N}\sum_{i=1}^N x_i = \frac{\bar{x}}{\alpha}</math> Substituting this into the log-likelihood function gives <math display=block>\ell(\alpha) = (\alpha-1)\sum_{i=1}^N \ln x_i -N\alpha - N\alpha\ln \left(\frac{\sum x_i}{\alpha N} \right) - N\ln \Gamma(\alpha)</math> We need at least two samples: <math>N\ge2</math>, because for <math>N=1</math>, the function <math>\ell(\alpha)</math> increases without bounds as <math>\alpha\to\infty</math>. For <math>\alpha>0</math>, it can be verified that <math>\ell(\alpha)</math> is strictly [[concave function|concave]], by using [[Polygamma function#Inequalities|inequality properties of the polygamma function]]. Finding the maximum with respect to {{mvar|α}} by taking the derivative and setting it equal to zero yields <math display=block>\ln \alpha - \psi(\alpha) = \ln\left(\frac{1}{N}\sum_{i=1}^N x_i\right) - \frac 1 N \sum_{i=1}^N \ln x_i = \ln \bar{x} - \overline{\ln x}</math> where {{mvar|ψ}} is the [[digamma function]] and <math>\overline{\ln x}</math> is the sample mean of {{math|ln ''x''}}. There is no closed-form solution for {{mvar|α}}. The function is numerically very well behaved, so if a numerical solution is desired, it can be found using, for example, [[Newton's method]]. An initial value of {{mvar|k}} can be found either using the [[method of moments (statistics)|method of moments]], or using the approximation <math display=block>\ln \alpha - \psi(\alpha) \approx \frac{1}{2\alpha}\left(1 + \frac{1}{6\alpha + 1} \right)</math> If we let <math display=block>s = \ln \left(\frac 1 N \sum_{i=1}^N x_i\right) - \frac 1 N \sum_{i=1}^N \ln x_i = \ln \bar{x} - \overline{\ln x}</math> then {{mvar|α}} is approximately <math display=block>k \approx \frac{3 - s + \sqrt{(s - 3)^2 + 24s}}{12s}</math> which is within 1.5% of the correct value.<ref>{{cite web |last=Minka |first=Thomas P. |year=2002 |title=Estimating a Gamma distribution |url=https://tminka.github.io/papers/minka-gamma.pdf }}</ref> An explicit form for the Newton–Raphson update of this initial guess is:<ref>{{cite journal |last1=Choi |first1=S. C. |last2=Wette |first2=R. |year=1969 |title=Maximum Likelihood Estimation of the Parameters of the Gamma Distribution and Their Bias |journal=Technometrics |volume=11 |issue=4 |pages=683–690 |doi=10.1080/00401706.1969.10490731 }}</ref> <math display=block>\alpha \leftarrow \alpha - \frac{ \ln \alpha - \psi(k) - s }{ \frac 1 \alpha - \psi\prime(\alpha) }.</math> At the maximum-likelihood estimate <math>(\hat \alpha,\hat\theta)</math>, the expected values for {{mvar|x}} and <math>\ln x</math> agree with the empirical averages: <math display=block> \begin{align} \hat \alpha\hat\theta &= \bar x &&\text{and} & \psi(\hat \alpha)+\ln \hat\theta &= \overline{\ln x}. \end{align} </math> =====Caveat for small shape parameter===== For data, <math>(x_1,\ldots,x_N)</math>, that is represented in a [[floating point]] format that underflows to 0 for values smaller than <math>\varepsilon</math>, the logarithms that are needed for the maximum-likelihood estimate will cause failure if there are any underflows. If we assume the data was generated by a gamma distribution with cdf <math>F(x;\alpha,\theta)</math>, then the probability that there is at least one underflow is: <math display=block> P(\text{underflow}) = 1-(1-F(\varepsilon;\alpha,\theta))^N </math> This probability will approach 1 for small {{mvar|α}} and large {{mvar|N}}. For example, at <math>\alpha=10^{-2}</math>, <math>N=10^4</math> and <math>\varepsilon=2.25\times10^{-308}</math>, <math>P(\text{underflow})\approx 0.9998</math>. A workaround is to instead have the data in logarithmic format. In order to test an implementation of a maximum-likelihood estimator that takes logarithmic data as input, it is useful to be able to generate non-underflowing logarithms of random gamma variates, when <math>\alpha<1</math>. Following the implementation in <code>scipy.stats.loggamma</code>, this can be done as follows:<ref name="Marsaglia-2000" /> sample <math>Y\sim\text{Gamma}(\alpha+1,\theta)</math> and <math>U\sim\text{Uniform}</math> independently. Then the required logarithmic sample is <math>Z=\ln(Y)+\ln(U)/\alpha</math>, so that <math>\exp(Z)\sim\text{Gamma}(k,\theta)</math>. ==== Closed-form estimators ==== There exist consistent closed-form estimators of {{mvar|α}} and {{mvar|θ}} that are derived from the likelihood of the [[generalized gamma distribution]].<ref>{{cite journal | url=https://amstat.tandfonline.com/doi/abs/10.1080/00031305.2016.1209129 | doi=10.1080/00031305.2016.1209129 | title=Closed-Form Estimators for the Gamma Distribution Derived from Likelihood Equations | year=2017 | last1=Ye | first1=Zhi-Sheng | last2=Chen | first2=Nan | journal=The American Statistician | volume=71 | issue=2 | pages=177–181 | s2cid=124682698 | access-date=2019-07-27 | archive-date=2023-05-26 | archive-url=https://web.archive.org/web/20230526181723/https://amstat.tandfonline.com/doi/abs/10.1080/00031305.2016.1209129 | url-status=live | url-access=subscription }}</ref> The estimate for the shape {{mvar|α}} is <math display=block>\hat{\alpha} = \frac{N \sum_{i=1}^N x_i}{N \sum_{i=1}^N x_i \ln x_i - \sum_{i=1}^N x_i \sum_{i=1}^N \ln x_i} </math> and the estimate for the scale {{mvar|θ}} is <math display=block>\hat{\theta} = \frac{1}{N^2} \left(N \sum_{i=1}^N x_i \ln x_i - \sum_{i=1}^N x_i \sum_{i=1}^N \ln x_i\right) </math> Using the sample mean of {{mvar|x}}, the sample mean of {{math|ln ''x''}}, and the sample mean of the product {{math|''x''·ln ''x''}} simplifies the expressions to: <math display=block>\hat{\alpha} = \bar{x} / \hat{\theta}</math> <math display=block>\hat{\theta} = \overline{x\ln x} - \bar{x} \overline{\ln x}.</math> If the rate parameterization is used, the estimate of <math>\hat{\lambda} = 1/\hat{\theta}</math>. These estimators are not strictly maximum likelihood estimators, but are instead referred to as mixed type log-moment estimators. They have however similar efficiency as the maximum likelihood estimators. Although these estimators are consistent, they have a small bias. A bias-corrected variant of the estimator for the scale {{mvar|θ}} is <math display=block>\tilde{\theta} = \frac{N}{N - 1} \hat{\theta}</math> A bias correction for the shape parameter {{mvar|α}} is given as<ref>{{cite journal | url=https://www.tandfonline.com/doi/abs/10.1080/00031305.2018.1513376 | doi=10.1080/00031305.2018.1513376 | title=A Note on Bias of Closed-Form Estimators for the Gamma Distribution Derived from Likelihood Equations | year=2019 | last1=Louzada | first1=Francisco | last2=Ramos | first2=Pedro L. | last3=Ramos | first3=Eduardo | journal=The American Statistician | volume=73 | issue=2 | pages=195–199 | s2cid=126086375 | access-date=2019-07-27 | archive-date=2023-05-26 | archive-url=https://web.archive.org/web/20230526181723/https://www.tandfonline.com/doi/abs/10.1080/00031305.2018.1513376 | url-status=live | url-access=subscription }}</ref> <math display=block>\tilde{\alpha} = \hat{\alpha} - \frac{1}{N} \left(3 \hat{\alpha} - \frac{2}{3} \left(\frac{\hat{\alpha}}{1 + \hat{\alpha}}\right) - \frac{4}{5} \frac{\hat{\alpha}}{(1 + \hat{\alpha})^2} \right) </math> ====Bayesian minimum mean squared error==== With known {{mvar|α}} and unknown {{mvar|θ}}, the posterior density function for theta (using the standard scale-invariant [[prior probability|prior]] for {{mvar|θ}}) is <math display=block>P(\theta \mid \alpha, x_1, \dots, x_N) \propto \frac 1 \theta \prod_{i=1}^N f(x_i; \alpha, \theta)</math> Denoting <math display=block> y \equiv \sum_{i=1}^Nx_i , \qquad P(\theta \mid \alpha, x_1, \dots, x_N) = C(x_i) \theta^{-N \alpha-1} e^{-y/\theta}</math> where the {{mvar|C}} (integration) constant does not depend on {{mvar|θ}}. The form of the posterior density reveals that {{math|1 / ''θ''}} is gamma-distributed with shape parameter {{math|''Nα'' + 2}} and rate parameter {{mvar|y}}. Integration with respect to {{mvar|θ}} can be carried out using a change of variables to find the integration constant <math display=block>\int_0^\infty \theta^{-N\alpha - 1 + m} e^{-y/\theta}\, d\theta = \int_0^\infty x^{N\alpha - 1 - m} e^{-xy} \, dx = y^{-(N\alpha - m)} \Gamma(N\alpha - m) \!</math> The moments can be computed by taking the ratio ({{mvar|m}} by {{math|1=''m'' = 0}}) <math display=block>\operatorname{E} [x^m] = \frac {\Gamma (N\alpha - m)} {\Gamma(N\alpha)} y^m</math> which shows that the mean ± standard deviation estimate of the posterior distribution for {{mvar|θ}} is <math display=block> \frac y {N\alpha - 1} \pm \sqrt{\frac {y^2} {(N\alpha - 1)^2 (N\alpha - 2)}}. </math> ===Bayesian inference=== ====Conjugate prior==== In [[Bayesian inference]], the '''gamma distribution''' is the [[conjugate prior]] to many likelihood distributions: the [[Poisson distribution|Poisson]], [[Exponential distribution|exponential]], [[Normal distribution|normal]] (with known mean), [[Pareto distribution|Pareto]], gamma with known shape {{mvar|σ}}, [[inverse gamma]] with known shape parameter, and [[Gompertz distribution|Gompertz]] with known scale parameter. <!-- reference: see article [[conjugate prior]] //--> The gamma distribution's [[conjugate prior]] is:<ref name="Fink">Fink, D. 1995 [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.157.5540&rep=rep1&type=pdf A Compendium of Conjugate Priors]. In progress report: Extension and enhancement of methods for setting data quality objectives. (DOE contract 95‑831).</ref> <math display=block>p(\alpha,\theta \mid p, q, r, s) = \frac{1}{Z} \frac{p^{\alpha-1} e^{-\theta^{-1} q}}{\Gamma(\alpha)^r \theta^{\alpha s}},</math> where {{mvar|Z}} is the normalizing constant with no closed-form solution. The posterior distribution can be found by updating the parameters as follows: <math display=block>\begin{align} p' &= p\prod\nolimits_i x_i,\\ q' &= q + \sum\nolimits_i x_i,\\ r' &= r + n,\\ s' &= s + n, \end{align}</math> where {{mvar|n}} is the number of observations, and {{math|''x''<sub>''i''</sub>}} is the {{mvar|i}}-th observation from the gamma distribution. == Occurrence and applications == Consider a sequence of events, with the waiting time for each event being an exponential distribution with rate {{mvar|λ}}. Then the waiting time for the {{mvar|n}}-th event to occur is the gamma distribution with integer shape <math>\alpha = n</math>. This construction of the gamma distribution allows it to model a wide variety of phenomena where several sub-events, each taking time with exponential distribution, must happen in sequence for a major event to occur.<ref>{{Cite book |last=Jessica. |first=Scheiner, Samuel M., 1956- Gurevitch |url=http://worldcat.org/oclc/43694448 |title=Design and analysis of ecological experiments |date=2001 |publisher=Oxford University Press |isbn=0-19-513187-8 |chapter=13. Failure-time analysis |oclc=43694448 |chapter-url=https://books.google.com/books?id=AgsTDAAAQBAJ&dq=gamma+distribution+failure+waiting+time&pg=PA235 |access-date=2022-05-26 |archive-date=2024-10-09 |archive-url=https://web.archive.org/web/20241009203230/https://search.worldcat.org/title/43694448 |url-status=live }}</ref> Examples include the waiting time of [[Cell division|cell-division events]],<ref>{{Cite journal |last=Golubev |first=A. |date=March 2016 |title=Applications and implications of the exponentially modified gamma distribution as a model for time variabilities related to cell proliferation and gene expression |url=http://dx.doi.org/10.1016/j.jtbi.2015.12.027 |journal=Journal of Theoretical Biology |volume=393 |pages=203–217 |doi=10.1016/j.jtbi.2015.12.027 |pmid=26780652 |bibcode=2016JThBi.393..203G |issn=0022-5193 |access-date=2022-05-26 |archive-date=2024-10-09 |archive-url=https://web.archive.org/web/20241009203230/https://www.sciencedirect.com/unsupported_browser |url-status=live |url-access=subscription }}</ref> number of compensatory mutations for a given mutation,<ref>{{Cite journal |last1=Poon |first1=Art |last2=Davis |first2=Bradley H |last3=Chao |first3=Lin |date=2005-07-01 |title=The Coupon Collector and the Suppressor Mutation |url=http://dx.doi.org/10.1534/genetics.104.037259 |journal=Genetics |volume=170 |issue=3 |pages=1323–1332 |doi=10.1534/genetics.104.037259 |pmid=15879511 |pmc=1451182 |issn=1943-2631 |access-date=2022-05-26 |archive-date=2024-10-09 |archive-url=https://web.archive.org/web/20241009203231/https://academic.oup.com/genetics/article/170/3/1323/6060337 |url-status=live }}</ref> waiting time until a repair is necessary for a hydraulic system,<ref>{{Cite journal |last1=Vineyard |first1=Michael |last2=Amoako-Gyampah |first2=Kwasi |last3=Meredith |first3=Jack R |date=July 1999 |title=Failure rate distributions for flexible manufacturing systems: An empirical study |url=http://dx.doi.org/10.1016/s0377-2217(98)00096-4 |journal=European Journal of Operational Research |volume=116 |issue=1 |pages=139–155 |doi=10.1016/s0377-2217(98)00096-4 |issn=0377-2217 |access-date=2022-05-26 |archive-date=2024-10-09 |archive-url=https://web.archive.org/web/20241009203230/https://www.sciencedirect.com/unsupported_browser |url-status=live |url-access=subscription }}</ref> and so on. In biophysics, the dwell time between steps of a molecular motor like [[ATP synthase]] is nearly exponential at constant ATP concentration, revealing that each step of the motor takes a single ATP hydrolysis. If there were n ATP hydrolysis events, then it would be a gamma distribution with degree n.<ref>{{Cite journal |last1=Rief |first1=Matthias |last2=Rock |first2=Ronald S. |last3=Mehta |first3=Amit D. |last4=Mooseker |first4=Mark S. |last5=Cheney |first5=Richard E. |last6=Spudich |first6=James A. |date=2000-08-15 |title=Myosin-V stepping kinetics: A molecular model for processivity |journal=Proceedings of the National Academy of Sciences |language=en |volume=97 |issue=17 |pages=9482–9486 |doi=10.1073/pnas.97.17.9482 |issn=0027-8424 |pmc=16890 |pmid=10944217 |doi-access=free |bibcode=2000PNAS...97.9482R }}</ref> The gamma distribution has been used to model the size of [[insurance policy|insurance claims]]<ref>p. 43, Philip J. Boland, Statistical and Probabilistic Methods in Actuarial Science, Chapman & Hall CRC 2007</ref> and rainfalls.<ref>{{Cite journal |last=Wilks |first=Daniel S. |date=1990 |title=Maximum Likelihood Estimation for the Gamma Distribution Using Data Containing Zeros |journal=Journal of Climate |volume=3 |issue=12 |pages=1495–1501 |doi=10.1175/1520-0442(1990)003<1495:MLEFTG>2.0.CO;2 |jstor=26196366 |bibcode=1990JCli....3.1495W |issn=0894-8755|doi-access=free }}</ref> This means that aggregate insurance claims and the amount of rainfall accumulated in a reservoir are modelled by a [[gamma process]] – much like the [[exponential distribution]] generates a [[Poisson process]]. The gamma distribution is also used to model errors in multi-level [[Poisson regression]] models because a [[mixture distribution|mixture]] of [[Poisson distribution]]s with gamma-distributed rates has a known closed form distribution, called [[negative binomial]]. In wireless communication, the gamma distribution is used to model the [[multi-path fading]] of signal power;{{citation needed|date=May 2019}} see also [[Rayleigh distribution]] and [[Rician distribution]]. In [[oncology]], the age distribution of [[cancer]] [[Disease incidence|incidence]] often follows the gamma distribution, wherein the shape and scale parameters predict, respectively, the number of [[Carcinogenesis|driver events]] and the time interval between them.<ref>{{cite journal |last1=Belikov |first1=Aleksey V. |title=The number of key carcinogenic events can be predicted from cancer incidence |journal=Scientific Reports |date=22 September 2017 |volume=7 |issue=1 |pages=12170 |doi=10.1038/s41598-017-12448-7|pmid=28939880 |pmc=5610194 |bibcode=2017NatSR...712170B }}</ref><ref>{{Cite journal|last1=Belikov|first1=Aleksey V.|last2=Vyatkin|first2=Alexey|last3=Leonov|first3=Sergey V.|date=2021-08-06|title=The Erlang distribution approximates the age distribution of incidence of childhood and young adulthood cancers|journal=PeerJ|language=en|volume=9|pages=e11976|doi=10.7717/peerj.11976|pmid=34434669|pmc=8351573|issn=2167-8359|doi-access=free}}</ref> In [[neuroscience]], the gamma distribution is often used to describe the distribution of [[Temporal coding|inter-spike intervals]].<ref name="Robson">J. G. Robson and J. B. Troy, "Nature of the maintained discharge of Q, X, and Y retinal ganglion cells of the cat", J. Opt. Soc. Am. A 4, 2301–2307 (1987)</ref><ref name="Wright, 2015">M.C.M. Wright, I.M. Winter, J.J. Forster, S. Bleeck "Response to best-frequency tone bursts in the ventral cochlear nucleus is governed by ordered inter-spike interval statistics", Hearing Research 317 (2014)</ref> In [[Bacterial genetics|bacterial]] [[gene expression]] where protein production can occur in bursts, the copy number of a given protein often follows the gamma distribution, where the shape and scale parameters are, respectively, the mean number of bursts per cell cycle and the mean number of [[protein molecule]]s produced per burst.<ref name="Friedman">N. Friedman, L. Cai and X. S. Xie (2006) "Linking stochastic dynamics to population distribution: An analytical framework of gene expression", ''Phys. Rev. Lett.'' 97, 168302.</ref> In [[genomics]], the gamma distribution was applied in [[peak calling]] step (i.e., in recognition of signal) in [[ChIP-chip]]<ref name="DJ Reiss">DJ Reiss, MT Facciotti and NS Baliga (2008) [https://web.archive.org/web/20121117144623/http://bioinformatics.oxfordjournals.org/content/24/3/396.full.pdf+html "Model-based deconvolution of genome-wide DNA binding"], ''Bioinformatics'', 24, 396–403</ref> and [[ChIP-seq]]<ref name="MA Mendoza">MA Mendoza-Parra, M Nowicka, W Van Gool, H Gronemeyer (2013) [http://www.biomedcentral.com/1471-2164/14/834 "Characterising ChIP-seq binding patterns by model-based peak shape deconvolution"] {{Webarchive|url=https://web.archive.org/web/20241009203230/https://bmcgenomics.biomedcentral.com/articles/10.1186/1471-2164-14-834 |date=2024-10-09 }}, ''BMC Genomics'', 14:834</ref> data analysis. In Bayesian statistics, the gamma distribution is widely used as a [[conjugate prior]]. It is the conjugate prior for the [[precision (statistics)|precision]] (i.e. inverse of the variance) of a [[normal distribution]]. It is also the conjugate prior for the [[exponential distribution]]. In [[phylogenetics]], the gamma distribution is the most commonly used approach to model among-sites rate variation<ref>{{Cite journal |last=Yang |first=Ziheng |date=September 1996 |title=Among-site rate variation and its impact on phylogenetic analyses |url=https://linkinghub.elsevier.com/retrieve/pii/0169534796100410 |journal=Trends in Ecology & Evolution |language=en |volume=11 |issue=9 |pages=367–372 |doi=10.1016/0169-5347(96)10041-0 |pmid=21237881 |bibcode=1996TEcoE..11..367Y |access-date=2023-09-06 |archive-date=2024-04-12 |archive-url=https://web.archive.org/web/20240412001342/https://linkinghub.elsevier.com/retrieve/pii/0169534796100410 |url-status=live |citeseerx=10.1.1.19.99 }}</ref> when [[Computational phylogenetics#Maximum likelihood|maximum likelihood]], [[Bayesian inference in phylogeny|Bayesian]], or [[Distance matrices in phylogeny|distance matrix methods]] are used to estimate phylogenetic trees. Phylogenetic analyzes that use the gamma distribution to model rate variation estimate a single parameter from the data because they limit consideration to distributions where {{math|1=''α'' = ''λ''}}. This parameterization means that the mean of this distribution is 1 and the variance is {{math|1/''α''}}. Maximum likelihood and Bayesian methods typically use a discrete approximation to the continuous gamma distribution.<ref>{{Cite journal |last=Yang |first=Ziheng |date=September 1994 |title=Maximum likelihood phylogenetic estimation from DNA sequences with variable rates over sites: Approximate methods |url=http://link.springer.com/10.1007/BF00160154 |journal=Journal of Molecular Evolution |language=en |volume=39 |issue=3 |pages=306–314 |doi=10.1007/BF00160154 |pmid=7932792 |bibcode=1994JMolE..39..306Y |s2cid=17911050 |issn=0022-2844 |access-date=2023-09-06 |archive-date=2024-10-09 |archive-url=https://web.archive.org/web/20241009203844/https://link.springer.com/article/10.1007/BF00160154 |url-status=live |citeseerx=10.1.1.19.6626 }}</ref><ref>{{Cite journal |last=Felsenstein |first=Joseph |date=2001-10-01 |title=Taking Variation of Evolutionary Rates Between Sites into Account in Inferring Phylogenies |url=http://link.springer.com/10.1007/s002390010234 |journal=Journal of Molecular Evolution |volume=53 |issue=4–5 |pages=447–455 |doi=10.1007/s002390010234 |pmid=11675604 |bibcode=2001JMolE..53..447F |s2cid=9791493 |issn=0022-2844 |access-date=2023-09-06 |archive-date=2024-10-09 |archive-url=https://web.archive.org/web/20241009203754/https://link.springer.com/article/10.1007/s002390010234 |url-status=live |url-access=subscription }}</ref> ==Random variate generation== Given the scaling property above, it is enough to generate gamma variables with {{math|1=''θ'' = 1}}, as we can later convert to any value of {{mvar|λ}} with a simple division. Suppose we wish to generate random variables from {{math|Gamma(''n'' + ''δ'', 1)}}, where n is a non-negative integer and {{math|0 < ''δ'' < 1}}. Using the fact that a {{math|Gamma(1, 1)}} distribution is the same as an {{math|Exp(1)}} distribution, and noting the method of [[Exponential distribution#Random variate generation|generating exponential variables]], we conclude that if {{mvar|U}} is [[uniform distribution (continuous)|uniformly distributed]] on (0, 1], then {{math|−ln ''U''}} is distributed {{math|Gamma(1, 1)}} (i.e. [[inverse transform sampling]]). Now, using the "{{mvar|α}}-addition" property of gamma distribution, we expand this result: <math display=block>-\sum_{k=1}^n \ln U_k \sim \Gamma(n, 1)</math> where {{math|''U''<sub>''k''</sub>}} are all uniformly distributed on (0, 1] and [[statistical independence|independent]]. All that is left now is to generate a variable distributed as {{math|Gamma(''δ'', 1)}} for {{math|0 < ''δ'' < 1}} and apply the "{{mvar|α}}-addition" property once more. This is the most difficult part. Random generation of gamma variates is discussed in detail by Devroye,<ref name="Devroye-1986">{{cite book |publisher=Springer-Verlag |location=New York |year=1986 |last=Devroye |first=Luc |url=http://luc.devroye.org/rnbookindex.html |title=Non-Uniform Random Variate Generation |isbn=978-0-387-96305-1 |access-date=2012-02-26 |archive-date=2012-07-17 |archive-url=https://web.archive.org/web/20120717112308/http://luc.devroye.org/rnbookindex.html |url-status=live }} See Chapter 9, Section 3.</ref>{{Rp|401–428}} noting that none are uniformly fast for all shape parameters. For small values of the shape parameter, the algorithms are often not valid.<ref name="Devroye-1986" />{{Rp|406}} For arbitrary values of the shape parameter, one can apply the Ahrens and Dieter<ref name="Ahrens-1982">{{Cite journal |last1=Ahrens |first1=J. H. |last2=Dieter |first2=U |date=January 1982 |title=Generating gamma variates by a modified rejection technique |journal=Communications of the ACM |volume=25 |issue=1 |pages=47–54 |doi=10.1145/358315.358390|s2cid=15128188 |doi-access=free }}. See Algorithm GD, p. 53.</ref> modified acceptance-rejection method Algorithm GD (shape {{math|''α'' ≥ 1}}), or transformation method<ref>{{cite journal |last1=Ahrens |first1=J. H. |last2=Dieter |first2=U. |year=1974 |title=Computer methods for sampling from gamma, beta, Poisson and binomial distributions |journal=Computing |volume=12 |issue=3 |pages=223–246 |citeseerx=10.1.1.93.3828 |doi=10.1007/BF02293108|s2cid=37484126 }}</ref> when {{math|0 < ''α'' < 1}}. Also see Cheng and Feast Algorithm GKM 3<ref>{{cite journal |url=https://www.jstor.org/stable/2347200|jstor=2347200 |title=Some Simple Gamma Variate Generators |last1=Cheng |first1=R. C. H. |last2=Feast |first2=G. M. |journal=Journal of the Royal Statistical Society. Series C (Applied Statistics) |year=1979 |volume=28 |issue=3 |pages=290–295 |doi=10.2307/2347200 |url-access=subscription }}</ref> or Marsaglia's squeeze method.<ref>Marsaglia, G. The squeeze method for generating gamma variates. Comput, Math. Appl. 3 (1977), 321–325.</ref> The following is a version of the Ahrens-Dieter [[rejection sampling|acceptance–rejection method]]:<ref name="Ahrens-1982"/> # Generate {{mvar|U}}, {{mvar|V}} and {{mvar|W}} as [[iid]] uniform (0, 1] variates. # If <math>U\le\frac e {e+\delta}</math> then <math>\xi=V^{1/\delta}</math> and <math>\eta=W\xi^{\delta-1}</math>. Otherwise, <math>\xi=1-\ln V</math> and <math>\eta=We^{-\xi}</math>. # If <math>\eta>\xi^{\delta-1}e^{-\xi}</math> then go to step 1. # {{mvar|ξ}} is distributed as {{math|Γ(''δ'', 1)}}. A summary of this is <math display=block> \theta \left( \xi - \sum_{i=1}^{\lfloor \alpha \rfloor} \ln U_i \right) \sim \Gamma (\alpha, \theta)</math> where <math>\scriptstyle \lfloor \alpha \rfloor</math> is the integer part of {{mvar|α}}, {{mvar|ξ}} is generated via the algorithm above with {{math|1=''δ'' = {{mset|''α''}}}} (the fractional part of {{mvar|α}}) and the {{math|''U''<sub>''k''</sub>}} are all independent. While the above approach is technically correct, Devroye notes that it is linear in the value of {{mvar|α}} and generally is not a good choice. Instead, he recommends using either rejection-based or table-based methods, depending on context.<ref name="Devroye-1986"/>{{Rp|401–428}} For example, Marsaglia's simple transformation-rejection method relying on one normal variate {{mvar|X}} and one uniform variate {{mvar|U}}:<ref name="Marsaglia-2000">{{cite journal |last1=Marsaglia|first1=G. |last2=Tsang |first2=W. W. |year=2000 |title=A simple method for generating gamma variables|journal=ACM Transactions on Mathematical Software|volume=26 |issue=3 |pages=363–372 |doi=10.1145/358407.358414|s2cid=2634158 }}</ref> # Set <math>d = a - \frac13</math> and <math>c = \frac1{\sqrt{9d}}</math>. # Set <math>v=(1+cX)^3</math>. # If <math>v > 0</math> and <math>\ln U < \frac{X^2}2 + d - dv + d\ln v</math> return <math>dv</math>, else go back to step 2. With <math> 1 \le a = \alpha </math> generates a gamma distributed random number in time that is approximately constant with {{mvar|&alpha}}. The acceptance rate does depend on {{mvar|α}}, with an acceptance rate of 0.95, 0.98, and 0.99 for ''α'' = 1, 2, and 4. For {{math|''α'' < 1}}, one can use <math> \gamma_\alpha = \gamma_{1+\alpha} U^{1/\alpha}</math> to boost {{mvar|k}} to be usable with this method. In [[Matlab]] numbers can be generated using the function gamrnd(), which uses the ''α'', ''θ'' representation. == References == {{Reflist|30em}} == External links == {{Wikibooks|Statistics|Distributions/Gamma|Gamma distribution}} * {{springer|title=Gamma-distribution|id=p/g043300}} * {{MathWorld|urlname=GammaDistribution|title=Gamma distribution}} * ModelAssist (2017) [http://www.epixanalytics.com/modelassist/AtRisk/Model_Assist.htm#Distributions/Continuous_distributions/Gamma.htm Uses of the gamma distribution in risk modeling, including applied examples in Excel] {{Webarchive|url=https://web.archive.org/web/20170509042425/http://www.epixanalytics.com/modelassist/AtRisk/Model_Assist.htm#Distributions/Continuous_distributions/Gamma.htm |date=2017-05-09 }}. * [http://www.itl.nist.gov/div898/handbook/eda/section3/eda366b.htm Engineering Statistics Handbook] {{ProbDistributions|continuous-semi-infinite}} {{DEFAULTSORT:Gamma Distribution}} [[Category:Continuous distributions]] [[Category:Factorial and binomial topics]] [[Category:Conjugate prior distributions]] [[Category:Exponential family distributions]] [[Category:Infinitely divisible probability distributions]] [[Category:Survival analysis]] [[Category:Gamma and related functions]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Bulleted list
(
edit
)
Template:Citation needed
(
edit
)
Template:Cite arXiv
(
edit
)
Template:Cite book
(
edit
)
Template:Cite journal
(
edit
)
Template:Cite web
(
edit
)
Template:Infobox probability distribution 2
(
edit
)
Template:Issn
(
edit
)
Template:Math
(
edit
)
Template:MathWorld
(
edit
)
Template:Mvar
(
edit
)
Template:ProbDistributions
(
edit
)
Template:Reflist
(
edit
)
Template:Rp
(
edit
)
Template:SfnRef
(
edit
)
Template:Short description
(
edit
)
Template:Sister project
(
edit
)
Template:Springer
(
edit
)
Template:Tmath
(
edit
)
Template:Webarchive
(
edit
)
Template:Wikibooks
(
edit
)