# 卡方分布

卡方分布（也写作chi-square，χ²）是一种连续概率分布，产生于将ν个独立标准正态变量平方后求和；项数ν是它唯一的参数，称为自由度。<sup>[1](https://www.itl.nist.gov/div898/handbook/eda/section3/eda3666.htm)</sup> 它是统计学中使用最广泛的分布之一，是皮尔逊拟合优度检验、列联表独立性检验以及总体方差的检验和置信区间的参考分布。<sup>[1](https://www.itl.nist.gov/div898/handbook/eda/section3/eda3666.htm)</sup>

| 关键事实 | 详情 |
|---|---|
| 定义 | ν个独立标准正态变量平方之和；ν为自由度<sup>[1](https://www.itl.nist.gov/div898/handbook/eda/section3/eda3666.htm)</sup> |
| 支撑集与密度 | 取值于0到∞，密度为 \( f(x) = \frac{e^{-x/2} x^{\nu/2 - 1}}{2^{\nu/2} \Gamma(\nu/2)} \)，其中 \( x \ge 0 \)<sup>[1](https://www.itl.nist.gov/div898/handbook/eda/section3/eda3666.htm)</sup> |
| 均值与方差 | 均值为ν；标准差为 \( \sqrt{2\nu} \)<sup>[1](https://www.itl.nist.gov/div898/handbook/eda/section3/eda3666.htm)</sup> |
| 形状 | 右偏；当ν > 2时众数为ν − 2，ν较大时中位数约为ν − 2/3<sup>[1](https://www.itl.nist.gov/div898/handbook/eda/section3/eda3666.htm)</sup> |
| 与伽马分布的关系 | 自由度为n的卡方变量是形状参数a = n/2、尺度参数b = 0.5（β = 2）的伽马变量<sup>[2](https://itl.nist.gov/div898/handbook/apr/section1/apr165.htm)</sup> |
| 可加性 | 自由度分别为ν₁, …, ν_N的独立卡方变量之和是自由度为ν = ν₁ + ⋯ + ν_N的卡方变量<sup>[3](https://ndl.ethernet.edu.et/bitstream/123456789/11555/1/Alan%20D.%20Chave_2017.pdf)</sup> |
| 起源 | 由卡尔·皮尔逊（Karl Pearson）在1900年7月发表的一篇论文中引入<sup>[4](https://extension.unr.edu/publication.aspx?PubID=8666)</sup><sup> • </sup><sup>[5](https://zenodo.org/records/1430618)</sup> |

## 数学形式

若 \( Z_1, Z_2, \ldots, Z_{\nu} \) 是独立标准正态变量，则

\[ X = Z_1^2 + Z_2^2 + \cdots + Z_{\nu}^2 \]

服从自由度为ν的卡方分布，记作 \( X \sim \chi^2(\nu) \)。每个平方后的标准正态变量为和贡献一个自由度。<sup>[1](https://www.itl.nist.gov/div898/handbook/eda/section3/eda3666.htm)</sup> 概率密度函数为

\[ f(x) = \frac{e^{-x/2} x^{\nu/2 - 1}}{2^{\nu/2} \Gamma(\nu/2)}, \qquad x \ge 0, \]

其中Γ为伽马函数，\( \Gamma(a) = \int_0^{\infty} t^{a-1} e^{-t} \, dt \)。<sup>[1](https://www.itl.nist.gov/div898/handbook/eda/section3/eda3666.htm)</sup> 累积分布函数通过不完全伽马函数表示，

\[ F(x) = \frac{\gamma(\nu/2,\, x/2)}{\Gamma(\nu/2)}, \qquad x \ge 0. \]

百分位点函数（CDF的反函数）没有简单的闭式表达，需通过数值方法计算。<sup>[1](https://www.itl.nist.gov/div898/handbook/eda/section3/eda3666.htm)</sup>

该分布是伽马分布族的一个特例：自由度为n的卡方变量是形状参数a = n/2、尺度参数b = 0.5的伽马变量，等价地，在率参数化下β = 2。<sup>[2](https://itl.nist.gov/div898/handbook/apr/section1/apr165.htm)</sup> 这一联系解释了它的许多性质，因为具有共同尺度的独立伽马变量之和仍为伽马变量。<sup>[3](https://ndl.ethernet.edu.et/bitstream/123456789/11555/1/Alan%20D.%20Chave_2017.pdf)</sup>

## 形状与汇总统计量

该分布仅对非负值有定义，且向右偏斜。自由度为ν时，其汇总统计量为：<sup>[1](https://www.itl.nist.gov/div898/handbook/eda/section3/eda3666.htm)</sup>

- 均值：ν
- 方差：2ν，因此标准差为 \( \sqrt{2\nu} \)
- 众数：ν − 2，对ν > 2有定义
- 中位数：ν较大时约为ν − 2/3
- 偏度：\( 2^{1.5}/\sqrt{\nu} \)
- 峰度：\( 3 + 12/\nu \)

当ν = 1时，密度在原点处达到峰值；随着ν增大，概率质量远离零点，曲线变为人们熟悉的右偏钟形卡方形状。<sup>[6](https://www.nicefa.org/library/applied-statistics/derivation-of-the-chi-square-distribution-from-sum-of-squared-standard-normal-variables)</sup> 偏度和超额峰度都随ν增大而趋近于零，因此自由度较大时分布趋近于正态。

两个结构性性质使该分布在实践中十分便利。第一，可加性：若N个独立变量各自服从卡方分布，自由度分别为ν₁至ν_N，则它们的和服从卡方分布，总自由度等于各自由度之和。<sup>[3](https://ndl.ethernet.edu.et/bitstream/123456789/11555/1/Alan%20D.%20Chave_2017.pdf)</sup> 第二，存在非正态输入下的推广：当被平方的变量具有非零均值时，其平方和服从非中心卡方分布，非中心参数为λ，当λ = 0时退化为普通的（中心）卡方分布。<sup>[7](https://rweb.cla.umn.edu/R/library/stats/html/Chisquare.html)</sup>

## 在假设检验中的作用

在检验语境中，卡方分布被视为无位置参数和尺度参数的标准化分布；临界域和置信区间直接从中读取。<sup>[1](https://www.itl.nist.gov/div898/handbook/eda/section3/eda3666.htm)</sup> 以下是三种经典用法。

**拟合优度。** 皮尔逊检验在k个分箱中比较观测计数 \( O_i \) 与期望计数 \( E_i \)：

\[ \chi^2 = \sum_{i=1}^{k} \frac{(O_i - E_i)^2}{E_i}. \]

该统计量近似服从自由度为k − c的卡方分布，其中k为非空单元格数，c为估计参数（位置、尺度和形状）的个数加1；例如对于三参数威布尔模型，c = 4。<sup>[8](https://www.itl.nist.gov/div898/handbook/eda/section3/eda35f.htm)</sup> 该检验可应用于任何能计算累积分布函数的单变量分布，且与柯尔莫哥洛夫-斯米尔诺夫检验和安德森-达林检验不同，它还能处理二项分布和泊松分布等离散分布。<sup>[8](https://www.itl.nist.gov/div898/handbook/eda/section3/eda35f.htm)</sup>

**列联表中的独立性。** 对于r × c的计数表，检验统计量

\[ T = \sum_{i=1}^{r} \sum_{j=1}^{c} \frac{(O_{ij} - E_{ij})^2}{E_{ij}}, \qquad E_{ij} = \frac{R_i C_j}{N}, \]

将每个观测单元格计数与行变量和列变量无关联时的期望计数进行比较；期望计数保持观测的行合计 \( R_i \) 和列合计 \( C_j \)。当T超过自由度为(r − 1)(c − 1)的卡方临界值时，拒绝独立性的原假设。<sup>[9](https://itl.nist.gov/div898/software/dataplot/refman1/auxillar/chistest.htm)</sup> 同样的自由度规则出现在费希尔1925年的论述中：在四格（2 × 2）表中，边际固定后只有一个单元格可以自由填充，因此n = 1；一般地，n = (r − 1)(c − 1)。<sup>[10](https://psychclassics.yorku.ca/Fisher/Methods/chap4.htm)</sup>

**正态总体的方差。** 对于样本量为N、标准差为s的样本，在总体标准差等于指定值σ₀的原假设下，统计量 \( T = (N-1)(s/\sigma_0)^2 \) 服从自由度为N − 1的卡方分布。同一关系给出方差的置信区间，下限和上限分别为 \( \sqrt{(N-1)s^2 / \chi^2_{1-\alpha/2,\,N-1}} \) 和 \( \sqrt{(N-1)s^2 / \chi^2_{\alpha/2,\,N-1}} \)。<sup>[11](https://www.itl.nist.gov/div898/handbook/eda/section3/eda358.htm)</sup>

## 有效性条件

卡方检验依赖渐近近似，因此当期望频数过小时临界值可能产生误导。科克伦的准则指出，若最小期望频数低于1，或20%的期望频数低于5，近似可能不佳；康诺弗认为在表格不是很小的情况下这一准则可能过于保守，建议最小值为0.5且至少一半的期望频数大于1。<sup>[9](https://itl.nist.gov/div898/software/dataplot/refman1/auxillar/chistest.htm)</sup> 当条件不满足时，补救措施包括在概念上合理的情况下合并稀疏的行或列，或改用费希尔精确检验。<sup>[9](https://itl.nist.gov/div898/software/dataplot/refman1/auxillar/chistest.htm)</sup> 拟合优度版本同样需要足够的样本量才能使近似有效，且其结果取决于数据的分箱方式。<sup>[8](https://www.itl.nist.gov/div898/handbook/eda/section3/eda35f.htm)</sup>

## 历史

卡尔·皮尔逊在1900年7月发表的一篇论文中引入了卡方框架，最初是作为一种将观测数据与统计模型下期望模式进行比较的方法。<sup>[4](https://extension.unr.edu/publication.aspx?PubID=8666)</sup> 该论文题为《论判定相关变量系统中一组给定的相对于期望值的偏差可被合理认为源于随机抽样的准则》，发表于《哲学杂志》，是皮尔逊卡方检验的起源。<sup>[5](https://zenodo.org/records/1430618)</sup> 对自由度参数的现代理解来自罗纳德·A·费希尔（Ronald A. Fisher），他1922年对卡方分布的证明被统计学史家认定为自由度概念的起源；费希尔表明，例如从数据中估计参数会减少检验可用的自由度。<sup>[12](https://old.maa.org/press/maa-reviews/classic-topics-on-the-history-of-modern-mathematical-statistics-from-laplace-to-more-recent-times)</sup><sup> • </sup><sup>[10](https://psychclassics.yorku.ca/Fisher/Methods/chap4.htm)</sup>

## References

1. [Chi-Square Distribution, NIST/SEMATECH e-Handbook of Statistical Methods, section 1.3.6.6.6](https://www.itl.nist.gov/div898/handbook/eda/section3/eda3666.htm)
2. [Gamma Distribution, NIST/SEMATECH e-Handbook of Statistical Methods, section 8.1.6.5](https://itl.nist.gov/div898/handbook/apr/section1/apr165.htm)
3. [Alan D. Chave (2017). Statistics course notes, chapter on the noncentral chi-square distribution](https://ndl.ethernet.edu.et/bitstream/123456789/11555/1/Alan%20D.%20Chave_2017.pdf)
4. [Copp, C. & Elgeberi, N. (2026). Declaring Independence, Evaluation Matters 2026-06, University of Nevada, Reno Extension](https://extension.unr.edu/publication.aspx?PubID=8666)
5. [Pearson, Karl (1900). On the criterion that a given system of deviations from the probable... Zenodo record](https://zenodo.org/records/1430618)
6. [Derivation of the Chi-Square Distribution from Sum of Squared Standard Normal Variables, nicefa library](https://www.nicefa.org/library/applied-statistics/derivation-of-the-chi-square-distribution-from-sum-of-squared-standard-normal-variables)
7. [The (non-central) Chi-Squared Distribution, R stats documentation, University of Minnesota](https://rweb.cla.umn.edu/R/library/stats/html/Chisquare.html)
8. [Chi-Square Goodness-of-Fit Test, NIST/SEMATECH e-Handbook, section 1.3.5.15](https://www.itl.nist.gov/div898/handbook/eda/section3/eda35f.htm)
9. [Chi-Square Independence Test, NIST Dataplot Reference Manual](https://itl.nist.gov/div898/software/dataplot/refman1/auxillar/chistest.htm)
10. [Fisher, R. A. (1925). Statistical Methods for Research Workers, Chapter 4, Classics in the History of Psychology](https://psychclassics.yorku.ca/Fisher/Methods/chap4.htm)
11. [Chi-Square Test for the Variance, NIST/SEMATECH e-Handbook, section 1.3.5.8](https://www.itl.nist.gov/div898/handbook/eda/section3/eda358.htm)
12. [Classic Topics on the History of Modern Mathematical Statistics, MAA review](https://old.maa.org/press/maa-reviews/classic-topics-on-the-history-of-modern-mathematical-statistics-from-laplace-to-more-recent-times)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; 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/chi-squared-distribution

English original: https://www.edgepedia.org/chi-squared-distribution
