Interactive demo · Probability and Statistical Inference · Chapter 3

The sample variance: dividing by n or by n − 1

Draw many samples of size n from a population with variance σ2, and from each compute the sum of squares SS = ∑(Xi − X)2 divided by n − 1, by n and by n + 1. Averaged over the samples, SS/(n − 1) lands on σ2 (Theorem 3.17: it is unbiased), while SS/n lands on (n − 1)σ2/n: the deviations are measured from X, which sits closer to the data than μ does. Unbiased is not the same as most accurate: the right panel shows the mean squared error of SS/d for every divisor d.

Population

Success probability p

Sample size n

Number of samples R

Random numbers

Try these

κ = E(X − μ)4/σ4 − 3 is the excess kurtosis of the population (0 for the normal). The theory curves use V(S2) = σ4{2/(n − 1) + κ/n}. The nerve population is the 799 waiting times between nerve pulses from the book's website, sampled with replacement, so its σ2 and κ are known exactly.

In the lecture notes