📚 Unbiased Estimates of the Mean and Variance | 均值和方差的无偏估计
In statistics, whenever we draw a random sample from a population, we use sample statistics to make inferences about unknown population parameters. The sample mean and sample variance are among the most frequently used estimators. For our conclusions to be trustworthy, we typically demand that these estimators be unbiased — meaning their expected value equals the true parameter being estimated. This article carefully explains why the sample mean is an unbiased estimator of the population mean, while the simplest version of the sample variance (using denominator n) is biased, and how we correct it to obtain an unbiased estimate of the population variance.
在统计学中,每当我们从总体中抽取一个随机样本,就会用样本统计量来推断未知的总体参数。样本均值和样本方差是最常用的估计量之一。为使结论可靠,我们通常要求这些估计量具有无偏性——即它们的期望值等于所估计的真实参数。本文将详细解释为什么样本均值是总体均值的无偏估计量,而最简单的样本方差(分母为 n)却是有偏的,以及如何将其校正为总体方差的无偏估计。
1. Population, Sample and Parameters | 总体、样本与参数
A population is the entire collection of individuals or items that we are interested in. A parameter is a numerical characteristic of the population, such as the population mean μ and population variance σ². Because it is usually impractical to measure the whole population, we take a random sample of size n and compute statistics from the sample data — for example, the sample mean x̄ and sample variance s². These statistics serve as estimators of the corresponding parameters.
总体是我们感兴趣的全体个体或项目的集合。参数是总体的数值特征,例如总体均值 μ 和总体方差 σ²。由于测量整个总体通常不切实际,我们抽取一个容量为 n 的随机样本,并根据样本数据计算统计量——例如样本均值 x̄ 和样本方差 s²。这些统计量就充当了对应参数的估计量。
2. What Makes an Estimator Unbiased? | 什么使估计量无偏?
Let θ be a population parameter and θ̂ an estimator calculated from a sample. We say that θ̂ is an unbiased estimator of θ if E(θ̂ taken over all possible random samples of the same size drawn from the population. If E(θ̂) ≠ θ, the estimator is biased, and the difference E(θ̂) − θ is called the bias. An unbiased estimator hits the true parameter value on average — it does not systematically overestimate or underestimate.
设 θ 为总体参数,θ̂ 为由样本计算出的估计量。如果 E(θ̂) = θ,我们就称 θ̂ 是 θ 的无偏估计量,其中期望是对所有相同容量的可能随机样本取的。如果 E(θ̂) ≠ θ,则估计量是有偏的,且差值 E(θ̂) − θ 称为偏差。无偏估计量在平均意义上能命中真实参数值——它不会系统性地高估或低估。
3. Sample Mean Is an Unbiased Estimator of μ | 样本均值是 μ 的无偏估计
Consider a random sample X1, X2, ..., Xn from a population with mean μ and variance σ². The sample mean is defined as x̄ = (1/n) ∑i=1n Xi. Taking expectations, E(x̄) = (1/n) ∑i=1n E(Xi) = (1/n) ⋅ nμ = μ. Therefore, x̄ is always an unbiased estimator of μ, regardless of the population distribution.
考虑从均值为 μ、方差为 σ² 的总体中抽取的随机样本 X1、X2、...、Xn。样本均值定义为 x̄ = (1/n) ∑i=1n Xi。取期望值:E(x̄) = (1/n) ∑i=1n E(Xi) = (1/n) ⋅ nμ = μ。因此,不管总体分布如何,x̄ 始终是 μ 的无偏估计量。
4. The Naive Sample Variance (Denominator n) | 简单的样本方差(分母为 n)
irst attempt at estimating the population variance σ² = E[(X − μ)²] is to replace μ with x̄ and average the squared deviations. This gives the naive estimator:
s2n = (1/n) ∑i=1n (Xi − x̄)2
Unfortunately, this quantity tends to be smaller than σ² on average, making it a biased estimator.
估计总体方差 σ² = E[(X − μ)²] 时,一个自然的初步尝试是用 x̄ 代替 μ 并对平方偏差取平均。由此得到简单估计量:
s2n = (1/n) ∑i=1n (Xi − x̄)2
令人遗憾的是,这个量在平均意义上通常小于 σ²,因而是一个有偏的估计量。
5. Why s2n Is Biased | 为什么 s2n 有偏
ntity is that the sum of squared deviations around the sample mean can be rewritten as ∑(Xi − μ)2 − n(x̄ − μ)2. Taking expectations yields:
E[∑(Xi − x̄)2] = (n − 1)σ²
Therefore, E(s2n) = (1/n) ⋅ − 1)/n) σ², which is less than σ² for any finite n. The bias factor is (n−1)/n, meaning s2n consistently underestimates the population variance.
核心恒等式是:围绕样本均值的平方偏差之和可以重写为 ∑(Xi − μ)2 − n(x̄ − μ)2。取期望后得到:
E[∑(Xi − x̄)2] = (n − 1)σ²
因此,E(s2n) = (1/n) ⋅ (n − 1)σ² = ((n − 1)/n) σ²,对于任何有限的 n 都小于 σ²。偏差因子为 (n−1)/n,这意味着 s2n 会一贯地低估总体方差。
6. Derivation of the Bias Step by Step | 偏差的逐步推导
Start with the sum of squares about μ: ∑(Xi − μ)2 = ∑[(Xi − x̄) + (x̄ − μ)]2. Expanding and simplifying gives ∑(Xi − x̄)2 + n(x̄ − μ)2. Also, E[∑(Xi − μ)2] = nσ² and E[n(x̄ − μ)2] = n ⋅ Var(x̄) = n ⋅ (σ²/n) = σ². Equating expectations leads directly to E[∑(Xi − x̄)2] = nσ² − σ² = (n − 1)σ².
从围绕 μ 的平方和开始:∑(Xi − μ)2 = ∑[(Xi − x̄) + (x̄ − μ)]2。展开并化简得到 ∑(Xi − x̄)2 + n(x̄ − μ)2。同时有 E[∑(Xi − μ)2] = nσ² 以及 E[n(x̄ − μ)2] = n ⋅ Var(x̄) = n ⋅ (σ²/n) = σ²。将期望值相等后直接推出 E[∑(Xi − x̄)2] = nσ² − σ² = (n − 1)σ²。
7. Bessel's Correction: The Unbiased Variance Estimator | 贝塞尔校正:无偏方差估计量
To remove the bias, we replace the denominator n with n − 1. The resulting estimator is known as the unbiased sample variance, often denoted s2:
s2 = (1/(n − 1)) ∑i=1n (Xi − x̄)2
Now E(s2) = (1/(n − 1)) ⋅ (n − 1)σ² = σ². This adjustment is called Bessel's correction, and s2 is the estimator universally adopted in inferential statistics.
为消除偏差,我们将分母 n 替换为 n − 1。由此得到的估计量被称为无偏样本方差,通常记为 s2:
s2 = (1/(n − 1)) ∑i=1n (Xi − x̄)2
此时 E(s2) = (1/(n − 1)) ⋅ (n − 1)σ² = σ²。这一调整称为贝塞尔校正,s2 是推断统计中普遍采用的估计量。
8. Degrees of Freedom — An Intuitive View | 自由度的直观理解
The reason we lose one degree of freedom when estimating variance is that we have already used the sample to estimate the mean x̄. Once x̄ is known, only n − 1 of the deviations (Xi − x̄) can vary freely; the last one is determined because ∑(Xi − x̄ − 1 instead of n compensates for this constraint and yields an unbiased variance estimate.
在估计方差时失去一个自由度的原因是,我们已经使用样本来估计了均值 x̄。一旦 x̄ 已知,偏差 (Xi − x̄) 中只有 n − 1 个可以自由变化;最后一个由关系 ∑(Xi − x̄) = 0 确定。除以 n − 1 而非 n 正是为了补偿这一约束,从而得到无偏的方差估计。
9. Comparing Biased and Unbiased Variance | 有偏与无偏方差的比较
| Estimator | Formula | Expected Value | Bias |
|---|---|---|---|
| Naive (biased) | s2n = (1/n)∑(Xi − x̄)2 | ((n−1)/n) σ² | Underestimates |
| Unbiased (Bessel) | s2 = (1/(n−1))∑(Xi − x̄)2 | σ² | 0 |
)/n → 1 when n → ∞. For large samples the difference is negligible, but for small n Bessel's correction is essential to avoid a systematic underestimation of variability.
表格说明,随着样本容量 n 增大,偏差会减小,因为当 n → ∞ 时 (n−1)/n → 1。对于大样本,差异可忽略不计;但对于小样本,贝塞尔校正对于避免系统性地低估变异程度至关重要。
10. Worked Example | 实例计算
is taken from a population. The observations are: 2, 4, 6, 8. Calculated sample mean is x̄ = 5.
假设从总体中抽取一个容量 n = 4 的样本,观测值为:2, 4, 6, 8。计算得样本均值 x̄ = 5。
(2−5)=−3, (4−5)=−1, (6−5)=1, (8−5)=3. Squared deviations: 9, 1, 1, 9. Sum of squares = 20.
偏差:(2−5)=−3, (4−5)=−1, (6−5)=1, (8−5)=3。平方偏差:9, 1, 1, 9。平方和 = 20。
Naive variance: s2n = 20/4 = 5. Unbiased variance: s2 ion variance σ² were 6.67, the naive estimator would on average give 5, clearly illustrating the bias.
简单方差:s2n = 20/4 = 5。无偏方差:s2 = 20/(4−1) ≈ 6.67。若真实的总体方差 σ² 为 6.67,简单估计量平均将给出 5,清楚显示了偏差的存在。
11. A Caution About the Standard Deviation | 关于标准差的一点注意
While s2 oot to estimate σ introduces a slight bias. The sample standard deviation s = √[1/(n−1)∑(Xi − x̄)2] is a biased estimator of σ, though the bias is typically small and s remains the most commonly used estimator of the population standard deviation in applied work.
虽然 s2 是 σ² 的无偏估计量,但开平方根来估计 σ 时会引入轻微的偏差。样本标准差 s = √[1/(n−1)∑(Xi − x̄)2] 是 σ 的有偏估计量,不过该偏差通常很小,s 仍然是应用中最常使用的总体标准差估计量。
12. Summary and Key Takeaways | 总结与要点
The sample mean x̄ is always an unbiased estimator of the population mean μ.
样本均值 x̄ 始终是总体均值 μ 的无偏估计量。
The variance estimator with denominator n, s2n, is biased and underestimates σ².
分母为 n 的方差估计量 s2n 是有偏的,会低估 σ²。
Bessel's correction — dividing by n−1 — removes the bias, yielding the unbiased sample variance s2.
贝塞尔校正——除以 n−1——消除了偏差,得到了无偏样本方差 s2。
The correction arises because estimating the mean uses one degree of freedom, effectively reducing the independent information in the squared deviations.
这一校正的根源在于,估计均值消耗了一个自由度,从而减少了平方偏差中的独立信息。
Understanding unbiasedness is essential for constructing confidence intervals, performing hypothesis tests, and interpreting regression output in IB and beyond.
理解无偏性对于构建置信区间、进行假设检验以及解释 IB 及更高阶课程中的回归结果都至关重要。
Published by TutorHao | Mathematics Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

或截图后用「扫一扫 → 相册」选择本图