# 伽马分布

伽马分布是一种针对正随机变量的连续概率分布，由形状参数与尺度（或率）参数定义，其密度行为取决于形状：形状大于一时，密度从零上升至众数后再下降；形状等于一时，密度自某一正值起单调下降；形状小于一时，密度自无穷大处下降。其尾部呈指数衰减<sup>[2](https://www.itl.nist.gov/div898/handbook/eda/section3/eda366b.htm)</sup>。它推广了指数分布，自然出现为泊松过程中等待固定数量事件发生的时间，并可用作寿命模型、率的共轭贝叶斯先验，以及伽马回归的响应族。

| 关键事实 | 详情 |
|---|---|
| 密度（形状–尺度） | \( f(t, \alpha, \beta) = \dfrac{1}{\beta^{\alpha}\Gamma(\alpha)}\, t^{\alpha-1} e^{-t/\beta} \)，其中形状 \( \alpha > 0 \)，尺度 \( \beta > 0 \)<sup>[1](https://itl.nist.gov/div898/handbook/apr/section1/apr165.htm)</sup> |
| 均值与方差 | 形状–尺度形式下为 \( \alpha\beta \) 与 \( \alpha\beta^{2} \)；等价地，形状–率形式下为 \( a/b \) 与 \( a/b^{2} \)<sup>[1](https://itl.nist.gov/div898/handbook/apr/section1/apr165.htm)</sup> |
| 特例 | 形状为1时给出指数分布；自由度为 \( n \) 的卡方分布是形状 \( a = n/2 \)、率 \( b = 0.5 \) 的伽马分布<sup>[1](https://itl.nist.gov/div898/handbook/apr/section1/apr165.htm)</sup> |
| 整数形状 | 当形状为正整数时，该分布称为埃尔朗分布，在排队论中频繁使用<sup>[1](https://itl.nist.gov/div898/handbook/apr/section1/apr165.htm)</sup> |
| 一般形式 | 三参数版本增加一个位置参数 \( \mu \)；\( \mu = 0 \)、\( \beta = 1 \) 的情形即标准伽马分布<sup>[2](https://www.itl.nist.gov/div898/handbook/eda/section3/eda366b.htm)</sup> |
| 软件 | R 提供 dgamma、pgamma、qgamma 和 rgamma，参数为形状与尺度（或率 = 1/尺度）；SciPy 的 gamma 接受单一形状参数外加 loc 与 scale<sup>[3](https://stat.ethz.ch/R-manual/R-devel/library/stats/help/dgamma.html)</sup><sup> • </sup><sup>[4](https://docs.scipy.org/doc/tutorial/stats.html)</sup> |

## 参数化

文献中占主导地位的有两种参数化，将它们混淆是常见的实际错误。在形状–率形式下，密度为 \( f(t, a, b) = \dfrac{b^{a}}{\Gamma(a)}\, t^{a-1} e^{-bt} \)，其中 \( b \) 是率；在形状–尺度形式下，密度为 \( f(t, \alpha, \beta) = \dfrac{1}{\beta^{\alpha}\Gamma(\alpha)}\, t^{\alpha-1} e^{-t/\beta} \)，其中尺度 \( \beta \) 是率的倒数。两者描述的是同一分布族，通过 \( \beta = 1/b \) 相联系，均值与方差也相应变化：\( a/b \) 与 \( a/b^{2} \) 对 \( \alpha\beta \) 与 \( \alpha\beta^{2} \)<sup>[1](https://itl.nist.gov/div898/handbook/apr/section1/apr165.htm)</sup>。

NIST《工程统计手册》指出，不同作者对形状与尺度参数还使用不同的符号，因此书面的伽马分布设定应始终说明所用的是哪一种参数化<sup>[1](https://itl.nist.gov/div898/handbook/apr/section1/apr165.htm)</sup>。

一般三参数形式增加一个位置参数 \( \mu \)，支撑集为 \( x \ge \mu \)，密度为 \( f(x) = \dfrac{\left(\frac{x-\mu}{\beta}\right)^{\gamma-1} \exp\left(-\frac{x-\mu}{\beta}\right)}{\beta\,\Gamma(\gamma)} \)，其中 \( \gamma \) 为形状，\( \beta \) 为尺度，\( \Gamma \) 为伽马函数 \( \Gamma(a) = \int_{0}^{\infty} t^{a-1} e^{-t}\,dt \)。令 \( \mu = 0 \)、\( \beta = 1 \) 即得标准伽马分布<sup>[2](https://www.itl.nist.gov/div898/handbook/eda/section3/eda366b.htm)</sup>。

## 伽马分布的由来

伽马分布是独立指数随机变量之和的分布。当服务台的到达遵循泊松过程时，等待第五位顾客出现所需的时间服从伽马分布，形状参数为5，率参数与到达率一致<sup>[5](https://archania.org/p/the-symbolic-world/mathematics/distributions/gamma-distribution)</sup>。更一般地，若一个系统有 \( n-1 \) 个待机备份单元，且系统及所有备份的寿命均服从参数为 \( \lambda \) 的指数分布，则总寿命服从形状 \( a = n \)、率 \( b = \lambda \) 的伽马分布<sup>[1](https://itl.nist.gov/div898/handbook/apr/section1/apr165.htm)</sup>。

这一可加性也赋予了伽马分布作为寿命模型的物理解释，而这是其在可靠性领域的主要竞争者威布尔分布所不具备的：威布尔分布纯粹是启发式的拟合，而伽马分布作为物理模型出现，因为指数寿命之和服从伽马分布<sup>[6](https://www.ncss.com/software/ncss/distribution-fitting-in-ncss/)</sup>。

## 特例与亲缘分布

将形状设为1，伽马分布就退化为率为 \( b = \lambda \) 的指数分布<sup>[1](https://itl.nist.gov/div898/handbook/apr/section1/apr165.htm)</sup>。卡方分布也是特例：自由度为 \( n \) 的卡方分布是形状 \( a = n/2 \)、率 \( b = 0.5 \)，等价地尺度 \( \beta = 2 \) 的伽马分布<sup>[1](https://itl.nist.gov/div898/handbook/apr/section1/apr165.htm)</sup>。当形状为正整数时，该分布即埃尔朗分布，是排队论中的主力工具<sup>[1](https://itl.nist.gov/div898/handbook/apr/section1/apr165.htm)</sup>。

该分布族向若干方向扩展。广义伽马分布在形状与失效率变化上增添了灵活性<sup>[7](https://www.ufpe.br/documents/39866/714959/tese015.pdf/2778dee7-5e03-4e74-bc0c-e9ce570c6852)</sup>；伽马–正态分布，即独立伽马变量与正态变量之和，其概率密度函数可通过抛物柱函数表达，被用作一种通用模型，适用于伽马型正分量受到对称噪声污染的情形<sup>[8](https://arxiv.org/abs/2402.11088)</sup>。

## 应用

**可靠性。** 伽马分布是一种灵活的寿命分布模型，可以拟合某些失效数据，不过对于常见失效机制，它作为寿命分布模型并未被广泛使用<sup>[1](https://itl.nist.gov/div898/handbook/apr/section1/apr165.htm)</sup>。它与威布尔分布竞争寿命模型的位置，但由于数学处理上更为复杂，使用较少<sup>[6](https://www.ncss.com/software/ncss/distribution-fitting-in-ncss/)</sup>。其可靠度与失效率函数直接由密度得出：\( R(t) = 1 - F(t) \) 与 \( h(t) = f(t)/R(t) \)<sup>[1](https://itl.nist.gov/div898/handbook/apr/section1/apr165.htm)</sup>。

**贝叶斯推断。** 当系统遵循修复率 \( \lambda \) 为常数的齐次泊松过程，且关于 \( \lambda \) 的先验信息可得时，为 \( \lambda \) 选取伽马先验是一种方便且流行的选择<sup>[1](https://itl.nist.gov/div898/handbook/apr/section1/apr165.htm)</sup>。原因在于共轭性：伽马分布是泊松率的共轭先验，因此后验仍是伽马分布，可以写成闭式<sup>[9](https://www.cs.columbia.edu/~blei/fogm/2020F/readings/Efron2018.pdf)</sup>。这种共轭性并不延伸到伽马分布自身的形状参数，后者不存在易于使用的共轭先验<sup>[10](https://arxiv.org/abs/1802.01610)</sup>。

**回归。** 伽马分布族是广义线性模型中标准的指数族选择之一；例如，statsmodels 提供带默认连接函数的 sm.families.Gamma()<sup>[11](https://www.statsmodels.org/stable/glm.html)</sup>。伽马广义线性模型广泛用于连续、非负、正偏态的响应变量，如保险理赔与生存数据<sup>[12](https://arxiv.org/abs/1804.07780)</sup>，而对数连接的伽马回归已被应用于由多波段测光估计星系的光度红移<sup>[13](https://arxiv.org/abs/1409.7699)</sup>。

**环境数据。** 由于灵活且能够刻画降雨观测的偏度，伽马分布至今仍是降雨量建模的流行选择<sup>[14](https://arxiv.org/abs/2607.04226)</sup>。

## 估计

参数通常用最大似然估计，以矩估计法作为起点。形状的一个快速矩估计为 \( \hat{\alpha} = \left[ \bar{t}/s_{t} \right]^{2} \)，即平均失效时间与失效时间标准差之比的平方<sup>[1](https://itl.nist.gov/div898/handbook/apr/section1/apr165.htm)</sup>。在双参数最大似然拟合中，矩估计值 \( \alpha_{0} = \bar{x}^{2}/\mathrm{var}(x) \) 与 \( \lambda_{0} = \bar{x}/\mathrm{var}(x) \) 用作数值起点，而理论费希尔信息矩阵涉及形状估计的三伽马函数<sup>[15](https://www.stat.umn.edu/geyer/s10/5102/examp/like.html)</sup>。

估计并不总是表现良好。对于三参数伽马分布，似然的局限性意味着通常可能需要非常大的样本量才能避免推断问题<sup>[16](https://www.tandfonline.com/doi/abs/10.1080/00949650213534)</sup>。在分布拟合中，伽马、威布尔、指数与对数正态候选模型之间的选择通常通过比较AIC与BIC值以及拟合优度统计量（如柯尔莫哥洛夫–斯米尔诺夫、克拉美–冯·米泽斯与安德森–达林统计量）来进行；在一个实例中，伽马分布的检验统计量最小，但指数分布的BIC更低，而三者之间的差异很小<sup>[17](https://educatus.github.io/simulation-book/chapter5.html)</sup>。

## References

1. [8.1.6.5. Gamma, NIST Engineering Statistics Handbook](https://itl.nist.gov/div898/handbook/apr/section1/apr165.htm)
2. [1.3.6.6.11. Gamma Distribution, NIST Engineering Statistics Handbook](https://www.itl.nist.gov/div898/handbook/eda/section3/eda366b.htm)
3. [The Gamma Distribution, R stats documentation](https://stat.ethz.ch/R-manual/R-devel/library/stats/help/dgamma.html)
4. [Statistics (scipy.stats), SciPy documentation](https://docs.scipy.org/doc/tutorial/stats.html)
5. [Gamma distribution, Archania](https://archania.org/p/the-symbolic-world/mathematics/distributions/gamma-distribution)
6. [Gamma Distribution Fitting, NCSS Statistical Software](https://www.ncss.com/software/ncss/distribution-fitting-in-ncss/)
7. [Generalized gamma distribution thesis, Federal University of Pernambuco](https://www.ufpe.br/documents/39866/714959/tese015.pdf/2778dee7-5e03-4e74-bc0c-e9ce570c6852)
8. [Properties and maximum likelihood estimation of the gamma-normal and related probability distributions, arXiv](https://arxiv.org/abs/2402.11088)
9. [Exponential Families in Theory and Practice, Bradley Efron (2018)](https://www.cs.columbia.edu/~blei/fogm/2020F/readings/Efron2018.pdf)
10. [Fast and accurate approximation of the full conditional for gamma shape parameters, arXiv](https://arxiv.org/abs/1802.01610)
11. [Generalized Linear Models, statsmodels documentation](https://www.statsmodels.org/stable/glm.html)
12. [Generalized Linear Model for Gamma Distributed Variables via Elastic Net Regularization, arXiv](https://arxiv.org/abs/1804.07780)
13. [The Overlooked Potential of Generalized Linear Models in Astronomy-II: Gamma regression and photometric redshifts, arXiv](https://arxiv.org/abs/1409.7699)
14. [Minimum Density Power Divergence Estimation for the Gamma Distribution with Applications to Robust Rainfall Modeling, arXiv](https://arxiv.org/abs/2607.04226)
15. [Statistics 5102 examples: Maximum Likelihood Estimation, University of Minnesota (Geyer)](https://www.stat.umn.edu/geyer/s10/5102/examp/like.html)
16. [Problems with Maximum Likelihood Estimation and the 3 Parameter Gamma Distribution, Journal of Statistical Computation and Simulation](https://www.tandfonline.com/doi/abs/10.1080/00949650213534)
17. [Estimating probability distributions from data, Simulation for Industrial Engineers](https://educatus.github.io/simulation-book/chapter5.html)

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Probability theory › Probability distributions › Distribution families and classification › Continuous univariate distribution families

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/gamma-distribution

English original: https://www.edgepedia.org/gamma-distribution
