Why Do We Divide by n-1 for Sample Variance? (The Intuitive & Mathematical Guide)
Why Do We Divide by (n - 1) in Sample Variance? Key point: Sample variance uses (n - 1) to remove bias caused by estimating the mean. Sample variance is defined as: s 2 = (1 / (n - 1)) ∑ i=1 n (x i - x̄) 2 The use of (n - 1) ensures that the estimator is unbiased. 1. Problem Definition Let a population have mean μ and variance σ 2 . We draw an i.i.d. sample: x 1 , ..., x n Sample mean: x̄ = (1 / n) ∑ x i 2. Naive Estimator and Bias Naive estimator: (1 / n) ∑(x i - x̄) 2 This estimator is biased downward: E[~s 2 ] < σ 2 3. Sample Mean Reduces Spread (Visualization) The sample mean minimizes squared deviations, which reduces observed spread. Figure 1. Sample points with true mean and sample mean. The sample mean shifts toward the data, reducing apparent variance. 4. Mathematical Derivation We now derive why dividing by n - 1 makes the sample variance unbiased. Assume that x 1 , x 2 , ..., x n are i.i.d. ...