physics2u
Depth
PU-106 / L08 · lecture

Estimating the Variance: Bias and Bessel's Correction

~6 min read · Tier toggle changes depth (T1 plain · T2 standard · T3 rigour)

BEFORE YOU START

You should be comfortable calculating the sample mean and understand that the population variance \(\sigma^2\) is a fixed but unknown constant. Familiarity with basic expectation notation \(\mathbb{E}[\cdot]\) is assumed.

Why this matters

Using the wrong divisor for variance systematically underestimates your uncertainty, leading to overconfident conclusions.

In experimental physics, the variance quantifies the spread of your data. If you estimate this spread using the same data used to estimate the mean, you introduce a subtle bias. Bessel's correction is the mathematical fix that ensures your reported error bars are honest. Without it, your confidence intervals will be too narrow, and you may falsely claim precision that your data does not support.

The Intuition: Why \(N-1\)?

Imagine you have a set of measurements. To calculate the variance, you need to know how far each point is from the "true" center. In theory, the center is the population mean \(\mu\). However, in practice, you do not know \(\mu\). Instead, you use the sample mean \(\bar{X}\), which you calculated from the very same data points.

Here is the key insight: because \(\bar{X}\) is the average of the data, the data points are, on average, closer to \(\bar{X}\) than they are to the true \(\mu\). Think of it this way: if you move the center of a circle to match the average position of a set of dots, the dots will naturally appear less spread out relative to that new center than they would relative to a fixed, external center. By using \(\bar{X}\), you have "used up" one degree of freedom to fit the center, leaving you with fewer independent pieces of information to estimate the spread. Dividing by \(N-1\) instead of \(N\) corrects for this loss of independence, scaling the result up slightly to give an unbiased estimate of the true population variance.

Defining the Estimators

Let \(X_1, \dots, X_N\) be independent, identically distributed random variables with finite mean \(\mu\) and finite variance \(\sigma^2\). The sample mean is defined as:

\[ \bar{X} = \frac{1}{N} \sum_{i=1}^{N} X_i \]

The sample variance, denoted \(s^2\), is defined with the divisor \(N-1\):

\[ s^2 = \frac{1}{N-1} \sum_{i=1}^{N} (X_i - \bar{X})^2 \]

If we had used \(N\) in the denominator, we would have obtained the biased estimator \(s_N^2 = \frac{1}{N} \sum_{i=1}^{N} (X_i - \bar{X})^2\). The relationship between the two is simply \(s^2 = \frac{N}{N-1} s_N^2\). For large \(N\), the difference is negligible, but for small samples (common in precision experiments), the correction is significant.

Unbiasedness and Expectation

An estimator is unbiased if its expected value equals the true parameter. For the variance, we require \(\mathbb{E}[s^2] = \sigma^2\). The derivation (cited as D-113) shows that this equality holds exactly when the divisor is \(N-1\).

Consider the sum of squared deviations from the sample mean. Algebraically, we can expand \(\sum (X_i - \bar{X})^2\) into \(\sum (X_i - \mu)^2 - N(\bar{X} - \mu)^2\). Taking the expectation, we know that \(\mathbb{E}[\sum (X_i - \mu)^2] = N\sigma^2\). However, the term \(N(\bar{X} - \mu)^2\) is not zero; its expectation is \(N \cdot \text{Var}(\bar{X}) = N \cdot \frac{\sigma^2}{N} = \sigma^2\). Therefore, the expected sum of squared deviations from the sample mean is \(N\sigma^2 - \sigma^2 = (N-1)\sigma^2\). To recover \(\sigma^2\), we must divide by \(N-1\). This confirms that \(s^2\) is an unbiased estimator of \(\sigma^2\).

Degrees of Freedom

The concept of degrees of freedom (dof) provides a physical interpretation of the \(N-1\) divisor. When estimating the variance, we are trying to determine the spread of the data. However, we have already used one constraint to determine the location of the data (the mean). Once the mean is fixed, the data points are no longer completely free to vary; they are constrained to sum to \(N\bar{X}\). This reduces the number of independent pieces of information available to estimate the spread from \(N\) to \(N-1\).

In general, if you estimate \(k\) parameters (such as the mean and the variance) from a sample of size \(N\), the degrees of freedom for the variance estimate will be \(N-k\). For a simple mean and variance estimation, \(k=1\) (the mean), so the dof is \(N-1\). This principle generalizes to linear regression, where the dof for the residual variance is \(N - p\), with \(p\) being the number of fitted parameters.

The derivation

◆ DERIVATION EMBED · D-113 · not re-derived here

Bessel's Correction for Sample Variance

Let X1, …, XN be independent, identically distributed random variables with finite mean μ = E[X] and finite variance σ2 = Var(X). Define the sample mean X̄ = (1/N) ∑i Xi and the sample variance s2 = (1/(N−1)) ∑i (Xi − X̄)2. Then E[s2] = σ2 exactly, for every N ≥ 2. The divisor N−1 — Bessel's correction — is precisely what makes the estimator unbiased once the mean has been estimated from the same data.

E[s2] = σ2,    where   s2 = (1/(N−1)) ∑i=1N (Xi − X̄)2
Open full derivation →
Tier 3 ยท watch out

Unbiasedness of the variance estimator does not imply that the standard deviation estimator \(s = \sqrt{s^2}\) is unbiased. Because the square root is a concave function, \(\mathbb{E}[\sqrt{s^2}] \neq \sqrt{\mathbb{E}[s^2]}\). In fact, \(s\) is a biased estimator of \(\sigma\), underestimating it slightly. For most experimental purposes, the bias in \(s\) is negligible for \(N \gt 10\), but for very small samples, one should use a correction factor (the \(c_4\) factor) if reporting the standard deviation as an unbiased estimate of \(\sigma\). C

Worked example

Problem. A student measures the period of a pendulum 5 times, obtaining the following values in seconds: 1.02, 1.05, 1.01, 1.04, 1.03. Calculate the sample mean and the unbiased sample variance.

  1. Calculate the sample mean \(\bar{X}\): \(\bar{X} = \frac{1.02 + 1.05 + 1.01 + 1.04 + 1.03}{5} = \frac{5.15}{5} = 1.03\ \mathrm{s}\).
  2. Calculate the squared deviations from the mean: \((1.02-1.03)^2 = 0.0001\), \((1.05-1.03)^2 = 0.0004\), \((1.01-1.03)^2 = 0.0004\), \((1.04-1.03)^2 = 0.0001\), \((1.03-1.03)^2 = 0.0000\).
  3. Sum the squared deviations: \(0.0001 + 0.0004 + 0.0004 + 0.0001 + 0.0000 = 0.0010\).
  4. Divide by \(N-1 = 4\) to get the unbiased variance: \(s^2 = \frac{0.0010}{4} = 0.00025\ \mathrm{s^2}\).
\[ s^2 = 2.5 \times 10^{-4}\ \mathrm{s^2} \]

Units check. The deviations are in seconds, so squared deviations are in \(\mathrm{s^2}\). The sum is in \(\mathrm{s^2}\). Dividing by a dimensionless number (\(N-1\)) leaves the units as \(\mathrm{s^2}\), which is correct for variance.

CHECK YOURSELF

Three quick tests

  1. Why do we divide by \(N-1\) instead of \(N\) when calculating sample variance?
    AnswerBecause we estimate the mean from the same data, reducing the degrees of freedom by 1. Dividing by \(N-1\) corrects the bias introduced by using the sample mean instead of the true population mean.
  2. If \(N=100\), what is the percentage difference between the biased variance (dividing by \(N\)) and the unbiased variance (dividing by \(N-1\))?
    AnswerThe ratio is \(\frac{N}{N-1} = \frac{100}{99} \approx 1.0101\). The unbiased variance is approximately 1.01% larger than the biased variance.
  3. Is the sample standard deviation \(s\) an unbiased estimator of the population standard deviation \(\sigma\)?
    AnswerNo. While \(s^2\) is unbiased for \(\sigma^2\), \(s\) is biased for \(\sigma\) due to the non-linearity of the square root function. It slightly underestimates \(\sigma\).
PROBLEMS

Problem set for PU-106 →

Each derivation in this unit ends with five graded problems with full solutions.

NOTES

Lecture notes drafted with a local model and checked line by line by the editor; every number in the worked example was recomputed.

Derivations cited: D-113 · Threads: chance