← 返回资讯屏轩教育 · 行业资讯

Degrees of Freedom | 自由度

2026-08-02 17:19 · 本文部分内容由AI辅助创作

📚 Degrees of Freedom | 自由度

In statistics, the term 'degrees of freedom' often puzzles students. It is not a physical quantity but a mathematical concept that counts how many independent pieces of information are available to estimate a parameter or to construct a test statistic. Whenever we use a sample to infer something about a population, certain constraints (like fixing the sample mean) reduce the number of values that can vary freely. Understanding degrees of freedom is essential for correctly applying chi-squared tests, t-tests, F-tests, and even the simple sample variance formula. This article explains degrees of freedom from first principles, linking intuition to formulas, and provides plenty of Edexcel A-Level relevant examples.

在统计学中,“自由度”这个术语常常让学生感到困惑。它不是一个物理量,而是一个数学概念,用于计算在估计参数或构建检验统计量时可用的独立信息的个数。每当我们使用样本推断总体时,某些约束条件(比如固定样本均值)会减少可以自由变化的数值个数。理解自由度对于正确应用卡方检验、t检验、F检验乃至简单的样本方差公式至关重要。本文将从头解释自由度的基本原理,将直觉与公式联系起来,并提供大量与Edexcel A-Level相关的例子。


1. What Are Degrees of Freedom? | 自由度的定义

Degrees of freedom, often denoted by the Greek letter ν (nu) or simply df, represent the number of independent values in a calculation that are free to vary after certain restrictions have been imposed. If you are asked to pick three numbers that sum to 10, you can freely choose the first two numbers. Once those are fixed, the third number is determined (10 − first − second). You had 2 degrees of freedom because one constraint (the fixed sum) reduced the freedom from 3 to 2. In statistical modelling, every time we estimate a parameter from the data, we use up one degree of freedom. The concept recurs in sampling distributions, hypothesis tests, and confidence intervals.

自由度通常用希腊字母 ν (nu) 或简写 df 表示,它代表在一个计算中,在施加了某些限制条件之后,可以自由变化的独立数值的个数。如果要你选出三个和为10的数,你可以自由选择前两个数。一旦这两个数确定,第三个数也随之确定(10 − 第一个数 − 第二个数)。你有2个自由度,因为一个约束条件(固定和)让自由度从3降到了2。在统计建模中,每从数据中估计一个参数,就会消耗一个自由度。这个概念在抽样分布、假设检验和置信区间中反复出现。


2. Intuitive Understanding: The Mean as a Constraint | 直觉理解:以均值为约束条件

bservations: x₁, x₂, ..., xₙ. Before we know anything, all n values can vary independently — there are n degrees of freedom. However, once we compute the sample mean x̄ raint. If you know n−1 of the observations and the sample mean, the last observation is forced to take a specific value. Hence, when using sample data to calculate the mean, the remaining data have n−1 degrees of freedom. This is why the formula for sample variance divides by n−1 rather than n: we lose one degree of freedom because we have used the data to estimate the mean.

考虑一个包含 n 个观测值的样本:x₁, x₂, …, xₙ。在我们不知道任何信息之前,所有 n 个值都可以独立变化 — 存在 n 个自由度。然而,一旦计算出样本均值 x̄ = (Σxᵢ)/n,我们就引入了一个约束条件。如果知道了 n−1 个观测值以及样本均值,最后一个观测值就必然取某个特定值。因此,当用样本数据计算均值时,剩下的数据就只有 n−1 个自由度。这就是为什么样本方差公式除以的是 n−1 而不是 n:因为我们用数据去估计均值,从而损失了一个自由度。


3. Degrees of Freedom in Sample Variance | 样本方差中的自由度

The unbiased estimator of population variance, σ², is given by s² = Σ(xᵢ − x̄ e degrees of freedom associated with the sum of squared deviations. Each deviation (xᵢ − x̄) is not independent because the sum of all deviations is zero (Σ(xᵢ − x̄ ator of σ². In the context of the t-distribution, the sample variance with n−1 degrees of freedom feeds directly into the t-statistic t = (x̄ − μ) / (s/√n), which follows a t-distribution with ν = n−1.

总体方差 σ² 的无偏估计量是 s² = Σ(xᵢ − x̄)² / (n−1)。分母 n−1 是与离差平方和关联的自由度。每个离差 (xᵢ − x̄) 并不相互独立,因为所有离差之和为零(Σ(xᵢ − x̄) = 0)。这个单一的线性约束将独立离差的个数从 n 减少到 n−1。除以 n−1 能确保 s² 是 σ² 的无偏估计量。在 t 分布的背景下,具有 n−1 自由度的样本方差直接代入 t 统计量 t = (x̄ − μ) / (s/√n),该统计量服从自由度为 ν = n−1 的 t 分布。


4. Degrees of Freedom in Chi-Squared Goodness-of-Fit Test | 卡方拟合优度检验的自由度

distribution. The test statistic is χ² = Σ (O − E)² / E. Here, O are observed counts and E are expected counts. The degrees of freedom for this test are generally (number of categories − 1) if no population parameters are estimated from the data. If we estimate parameters from the sample (e.g., using the sample mean to estimate the population mean for a Poisson model), we lose additional degrees of freedom. The rule is: ν = k − 1 − p, where k is the number of categories and p is the number of parameters estimated from the data.

卡方拟合优度检验用于检验观测频数与指定分布下的期望频数之间是否存在显著差异。检验统计量为 χ² = Σ (O − E)² / E。这里 O 是观测频数,E 为期望频数。如果没有从数据中估计总体参数,该检验的自由度一般为 (类别数 − 1)。如果利用样本估计参数(例如用样本均值估计泊松模型的总体均值),则会损失额外的自由度。规则是:ν = k − 1 − p,其中 k 是类别数,p 是从数据中估计的参数个数。

hesis (pᵢ = 1/6). No parameters are estimated, so ν = 6 − 1 = 5. If instead we test whether data follow a binomial distribution Binomial(n, p) with p estimated from the sample, then ν = k − 1 − 1 = k − 2. In Edexcel exam questions, you must carefully check whether any parameters are estimated from the observed data to apply the correct degrees of freedom.

例如,假设我们要检验一粒骰子是否均匀。有6个类别(点数1到6),所有概率由原假设给出(pᵢ = 1/6)。没有参数被估计,因此 ν = 6 − 1 = 5。如果改为检验数据是否遵循二项分布 Binomial(n, p),并且 p 是从样本中估计的,则 ν = k − 1 − 1 = k − 2。在 Edexcel 考试题目中,必须仔细检查是否有任何参数是从观测数据中估计的,以使用正确的自由度。


5. Degrees of Freedom in Contingency Tables | 列联表的自由度

able. If the marginal totals (row sums and column sums) are fixed, only one cell count can vary freely; the others are then determined by subtraction from those totals. In general, once (r−1) row margins and (c−1) column margins are fixed, the remaining frequencies are constrained, leaving (r−1)(c−1) free cells. Thus the test statistic χ² = Σ (O − E)² / E is compared to a chi-squared distribution with (r−1)(c−1) degrees of freedom.

对于 r × c 列联表中的独立性卡方检验,自由度计算公式为 (r − 1)(c − 1)。为什么是这样?考虑一个 2×2 表格,如果边际总和(行和与列和)固定,那么只有一个单元格的频数可以自由变化;其他单元格则通过从这些总和中减去该值而确定。一般地,一旦固定了 (r−1) 个行边际与 (c−1) 个列边际,剩下的频数即被约束,留下了 (r−1)(c−1) 个自由单元格。因此检验统计量 χ² = Σ (O − E)² / E 需要与自由度为 (r−1)(c−1) 的卡方分布进行比较。

Contingency TableDegrees of Freedom
2×2(2−1)(2−1) = 1
3×3(3−1)(3−1) = 4
2×4(2−1)(4−1) = 3

These values are critical when looking up the critical value from chi-squared tables. A common mistake is to use simply (number of cells − 1), which gives an incorrect and larger number of degrees of freedom. Always check that the data form a two-way table and apply the correct formula.

这些数值在查阅卡方分布表的临界值时至关重要。一个常见错误是直接用(单元格总数 − 1),这会导致自由度数值变大且不正确。务必要确认数据构成一个双向表格,并应用正确的公式。


广告 / Sponsored

6. Degrees of Freedom in the t-Distribution | t分布的自由度

ndard deviation s. The shape of the t-distribution depends solely on the degrees of freedom ν. For a single sample, ν = n−1. As the degrees of freedom increase (n gets larger), the t-distribution approaches the standard normal distribution N(0,1). In Edexcel Further Statistics, you also encounter the two-sample t-test where separate variances are estimated, leading to a more complex formula for degrees of freedom (Welch– ore A-Level, the most important use is the single-sample t-interval and test with ν = n−1.

t 分布描述的是当总体标准差未知而用样本标准差 s 估计时,样本均值的行为表现。t 分布的形状完全取决于自由度 ν。对于单个样本,ν = n−1。随着自由度的增加(n 变大),t 分布趋近于标准正态分布 N(0,1)。在 Edexcel 进阶统计学中,你还会遇到两样本 t 检验,需要分别估计方差,从而产生更复杂的自由度公式(Welch–Satterthwaite 公式)。但在基础 A-Level 中,最重要的用法是单样本 t 区间和检验,自由度为 ν = n−1。

For example, a 95% confidence interval for the population mean μ when σ is unknown is given by x̄ ± tₙ₋₁ (s/√n n−1 degrees of freedom. If a sample of 20 yields t = 2.09, the critical value t₁₉ at the 5% and the conclusion of the test, underlining the importance of correct degrees of freedom.

例如,当 σ 未知时,总体均值 μ 的 95% 置信区间由 x̄ ± tₙ₋₁ (s/√n) 给出,其中 tₙ₋₁ 是自由度为 n−1 的 t 分布临界值。如果一个样本量为 20 的样本得出 t = 2.09,那么在 5% 显著性水平(双尾)下 t₁₉ 的临界值约为 2.093。如果把 n−1 误改为 n,就会错误地改变 p 值以及检验结论,这突显了正确自由度的重要性。


7. Degrees of Freedom in the F-Distribution (ANOVA) | F分布与方差分析的自由度

ic has two degrees of freedom: ν₁ = k − 1 (between-group degrees of freedom) and ν₂ = N − k (within-group degrees of freedom), where k is the number of groups and N is the total number of observations. The numerator degrees of freedom correspond to the number of group means being compared minus 1; the denominator degrees of freedom reflect the total sample size minus the number of groups, because each group mean estimate uses up one degree of freedom.

在单因素方差分析(ANOVA)中,F 检验比较组间变异与组内变异的比值。F 统计量有两个自由度:ν₁ = k − 1(组间自由度)和 ν₂ = N − k(组内自由度),其中 k 为组数,N 为总观测次数。分子的自由度对应于被比较的组平均数个数减 1;分母的自由度反映总样本量减去组数,因为每个组均值的估计消耗一个自由度。

fect and error) is a powerful illustration of the additive nature of degrees of freedom: total df = between-group df + within-group df. This additivity holds in many linear models and helps check calculations in exam questions.

虽然方差分析主要在进阶数学中涉及,但将总自由度 (N−1) 分解为若干部分(组效应和误差)的原理有力地说明了自由度的可加性:总 df = 组间 df + 组内 df。这种可加性在许多线性模型中成立,并有助于在考试中检验计算是否正确。


8. Degrees of Freedom in Mechanics (Rigid Bodies) | 力学中的自由度(刚体)

Outside the statistics syllabus, the idea of degrees of freedom also appears in mechanics when describing the motion of a particle or a rigid body. A particle moving freely in two dimensions has 2 degrees of freedom (x and y coordinates). A rigid body moving in a plane can translate in two directions and rotate about an axis perpendicular to the plane, giving 3 degrees of freedom (two translational, one rotational). In three-dimensional space, a free rigid body has 6 degrees of freedom (3 translations and 3 rotations). Although this usage is different from the statistical one, the underlying concept is similar: the number of independent ways the system can move or vary.

在统计学大纲之外,自由度的概念也出现在力学中,用于描述质点或刚体的运动。一个质点在二维空间中自由运动有 2 个自由度(x 坐标和 y 坐标)。一个在平面上运动的刚体可以沿两个方向平动,并绕垂直于平面的轴转动,因此有 3 个自由度(两个平动、一个转动)。在三维空间,一个自由刚体有 6 个自由度(三个平动和三个转动)。虽然这种用法与统计学中的有所不同,但基本概念是相似的:系统能够独立移动或变化的方式的个数。

For Edexcel Mechanics modules, you might encounter constraints that reduce degrees of freedom, such as a particle constrained to move along a fixed line (1 degree of freedom) or a rod attached to a pivot (1 rotational degree of freedom). Recognising analogous constraints helps build a broader understanding of 'freedom' in mathematical modelling.

在 Edexcel 力学模块中,你可能会遇到减少自由度的约束条件,比如限制质点在一条固定直线上运动(1个自由度),或者连接在枢轴上的杆(1个转动自由度)。认识这些类似的约束有助于建立对数学建模中“自由度”的更广泛理解。


9. Common Mistakes and Exam Tips | 常见错误与考试技巧

odness-of-fit, count parameters estimated from the sample (like using the sample mean to derive expected frequencies) and subtract them. For contingency tables, do not blindly use (number of cells − 1); use (r−1)(c−1). When calculating sample variance, double-check that you are using n−1 in the denominator. In t-tests, be aware that pairing reduces the sample size and thus affects degrees of freedom (paired t-test uses differences, so ν = npairs − 1).

在 Edexcel 统计题中,许多分数失在学生对自由度的误判上。一定要清楚识别约束条件。在拟合优度中,要数出从样本中估计的参数个数(如用样本均值推导期望频数)并将其减去。对于列联表,不要盲目使用(单元格总数 − 1),而要用 (r−1)(c−1)。在计算样本方差时,再次检查分母是否用了 n−1。在 t 检验中,注意配对会减少样本量从而影响自由度(配对 t 检验使用差值,故 ν = 数据对数量 − 1)。

s of freedom for different χ² tests. A goodness-of-fit test on a discrete distribution may need extra subtractions if parameters are estimated. For example, testing a Poisson distribution with mean λ estimated as the sample mean x̄ r independence, the marginal totals are not fixed by hypothesis but by data, yet the same (r−1)(c−1) rule applies. Practice past paper questions where you have to calculate expected frequencies, then determine ν, and finally look up the critical value.

另一个陷阱是混淆不同 χ² 检验的自由度。离散分布的拟合优度检验如果估计了参数,可能需要额外减去。例如,检验一个泊松分布,其均值 λ 用样本均值 x̄ 估计,则 ν = k − 2。在双向表的独立性检验中,边际总和并非由假设固定,而是由数据得到,但同样适用 (r−1)(c−1) 规则。多练习历年真题,先计算期望频数,然后确定 ν,最后查表找临界值,就能避错。


10. Summary | 总结

ng parameters. In sample variance, we use n−1; in t-tests, ν = n−1; in chi-squared goodness-of-fit, ν = k − 1 − p; in contingency tables, ν = (r−1)(c−1); in ANOVA, degrees of freedom split into between- and within-group components. Outside statistics, mechanics offers a geometric interpretation of independence of movement. Mastering degrees of freedom enables you to correctly perform hypothesis tests, construct confidence intervals, and avoid common examiner pitfalls, ensuring full marks on Edexcel A-Level questions.

自由度用于计算统计计算中独立信息的个数,它们为估计参数所引入的约束条件进行调整。在样本方差中,我们用 n−1;在 t 检验中,ν = n−1;在卡方拟合优度中,ν = k − 1 − p;在列联表中,ν = (r−1)(c−1);在 ANOVA 中,自由度分解为组间和组内部分。在统计学之外,力学给运动独立性提供了几何解释。掌握自由度能让你正确进行假设检验、构建置信区间并避开阅卷人设下的常见陷阱,从而在 Edexcel A-Level 考题中拿到满分。

Published by TutorHao | Mathematics Revision Series | aleveler.com

广告 / Sponsored
英文原版 Collins International Lower Secondary Computing 柯林斯国际初…
计算机 备考教辅 · 正版现货 · 与本文同科同级别
查看详情 / View on Taobao

更多咨询请联系16621398022(同微信)

备考资讯每日更新,关注不错过
考纲变化 · 科目分析 · 学习方法
扫码关注公众号 tutorhao
在微信里长按二维码识别关注
或截图后用「扫一扫 → 相册」选择本图
公众号:tutorhao