Estimators, Bias and Variance: Why Unbiased Is Not the Same as Good
Published:
An estimator is a random variable
An estimator is any function of the sample, \(\hat{\theta} = g(x_1,\dots,x_n)\), used to guess an unknown parameter \(\theta\). The sample mean is one; so is the sample median, the sample maximum, and the constant function that always returns 7. Nothing about the definition requires the estimator to be sensible.
The important consequence is that because the sample is random, \(\hat{\theta}\) is random. It has a distribution — the sampling distribution — and every property below is a property of that distribution, not of the single number you computed from your one dataset.
Four properties
Bias is the systematic offset, \(\mathrm{Bias}(\hat\theta) = \mathbb{E}[\hat\theta] - \theta\). The sample mean is unbiased for \(\mu\). The maximum-likelihood variance \(\frac{1}{n}\sum_i(x_i-\bar{x})^2\) is biased downwards by a factor \((n-1)/n\), as descriptive statistics derives.
Variance is the scatter, \(\mathrm{Var}(\hat\theta) = \mathbb{E}\big[(\hat\theta - \mathbb{E}[\hat\theta])^2\big]\) — how much the answer would move if you collected a different sample of the same size.
Consistency is an asymptotic guarantee: \(\hat\theta_n \to \theta\) in probability as \(n \to \infty\). Consistency and unbiasedness are independent. The MLE of variance is biased at every finite \(n\) yet consistent, since the factor \((n-1)/n \to 1\). Conversely, “use \(x_1\) and ignore the rest” is unbiased for \(\mu\) and never consistent.
Efficiency compares variances among unbiased estimators. The Cramér–Rao bound says no unbiased estimator can beat the inverse Fisher information:
Here \(I(\theta)\) is the information a single observation carries about \(\theta\): the expected curvature of the log-density. Sharp curvature means the likelihood changes fast as \(\theta\) moves, so \(\theta\) is easy to pin down. An estimator attaining the bound is called efficient — the sample mean is efficient for a Gaussian mean.
The decomposition
Write \(\bar\theta = \mathbb{E}[\hat\theta]\) and add and subtract it inside the square:
The cross term dies because \(\bar\theta-\theta\) is a constant and \(\hat\theta - \bar\theta\) has mean zero by definition. So
This is an identity, not an approximation and not a trade-off law. It says squared error has exactly two sources, and any estimator that reduces one by more than it inflates the other is an improvement.
The same algebra applied to prediction gives the familiar three-term version. For a target \(y = f(x) + \varepsilon\) with \(\mathrm{Var}(\varepsilon)=\sigma^2\) and a model \(\hat{f}\) trained on a random dataset, the expected squared error at a fixed \(x\) is \(\sigma^2 + \mathrm{Bias}(\hat f(x))^2 + \mathrm{Var}(\hat f(x))\). The extra \(\sigma^2\) is irreducible noise — no model removes it. Underfitting is the bias term dominating; overfitting is the variance term dominating, the model chasing sampling noise that a different training set would not have contained.
Buying a lower error with bias
Suppose \(\bar{x} \sim \mathcal{N}(\mu, \sigma^2/n)\) and consider the shrunk estimator \(\hat\mu_c = c\,\bar{x}\) for a constant \(c \in [0,1]\). Its bias is \((c-1)\mu\) and its variance is \(c^2\sigma^2/n\), so
Take \(\mu = 1\), \(\sigma^2 = 1\), \(n = 4\), so \(\sigma^2/n = 0.25\) and \(c^\star = 1/1.25 = 0.8\).
| \(c\) | Variance | Bias² | MSE |
|---|---|---|---|
| 1.0 (unbiased) | 0.2500 | 0.0000 | 0.2500 |
| 0.9 | 0.2025 | 0.0100 | 0.2125 |
| 0.8 (optimal) | 0.1600 | 0.0400 | 0.2000 |
| 0.7 | 0.1225 | 0.0900 | 0.2125 |
| 0.5 | 0.0625 | 0.2500 | 0.3125 |
Shrinking by 20% cuts MSE from 0.2500 to 0.2000 — a 20% reduction — while guaranteeing the estimate is too small on average. The unbiased estimator is not even a local optimum: the derivative of MSE at \(c=1\) is \(2\sigma^2/n > 0\), so some shrinkage always helps.
Ridge, and the ML reading
Ridge regression is exactly this move for linear models: \(\hat\beta_{\text{ridge}} = (X^\top X + \lambda I)^{-1}X^\top y\) shrinks every coefficient towards zero, which biases the fit and lowers its variance. When predictors are correlated, \(X^\top X\) is near-singular, the ordinary least-squares variance explodes, and even a large \(\lambda\) pays for itself. Weight decay, early stopping and dropout all sit in the same family. Maximum likelihood shows that the ridge penalty is what a Gaussian prior looks like from the optimisation side.
Recap
- An estimator is a random variable; bias, variance, consistency and efficiency are properties of its sampling distribution.
- \(\mathrm{MSE} = \mathrm{Var} + \mathrm{Bias}^2\) exactly, and for prediction there is an extra irreducible \(\sigma^2\).
- Unbiased and consistent are independent properties — the MLE variance is biased but consistent.
- Shrinking by 20% in the worked example cut MSE by 20%; some shrinkage always helps because variance falls first-order while bias² grows second-order.
- Ridge, weight decay and early stopping are the same trade in a model with many parameters.
References
- Hoerl, A. E., & Kennard, R. W. Ridge Regression: Biased Estimation for Nonorthogonal Problems. Technometrics, 12(1), 55–67, 1970.
- Efron, B., & Morris, C. Data Analysis Using Stein’s Estimator and its Generalizations. Journal of the American Statistical Association, 70(350), 311–319, 1975.
- Belkin, M., Hsu, D., Ma, S., & Mandal, S. Reconciling modern machine-learning practice and the classical bias–variance trade-off. PNAS, 116(32), 15849–15854, 2019.
- Hastie, T., Tibshirani, R., & Friedman, J. The Elements of Statistical Learning, 2nd ed. Springer, 2009.
