Algorithm Search⌘K

Theoremcore

Gauss-Markov theorem

Also called BLUE theorem, best linear unbiased estimator.

In a linear model with uncorrelated errors of equal variance, ordinary least squares has the least variance among all linear unbiased estimators.

The Gauss-Markov theorem says that in a linear model whose errors have mean 0, are uncorrelated and have equal variance, the ordinary least squares estimator is the best linear unbiased estimator (BLUE): every other estimator that is linear in yy and unbiased for every value of the coefficients has a covariance matrix at least as large, in the order of positive semidefinite matrices. No normality is needed and no independence beyond zero correlation. All three conditions matter, and so do the two restrictions on the competitors: biased estimators such as ridge regression, and nonlinear unbiased estimators under a known non-normal error law, can do better. Gauss proved the result in 1821 to 1823; Aitken gave the matrix form and the extension to correlated errors in 1935.

Statement

Let y=Xb+εy = Xb + \varepsilon, where yy is the nn-vector of responses, XX is an n×pn \times p design matrix (its pp columns include the intercept, if any), b∈Rpb \in \mathbb{R}^p is the unknown coefficient vector, and ε\varepsilon is the error vector. Assume:

  1. Linear model of full rank. XX is fixed, or random with all statements conditional on XX, and has rank pp.
  2. Zero mean. E[ε∣X]=0\mathbb{E}[\varepsilon \mid X] = 0.
  3. Spherical errors. Var⁡(ε∣X)=σ2In\operatorname{Var}(\varepsilon \mid X) = \sigma^2 I_n for some σ2>0\sigma^2 > 0: the errors are uncorrelated and have equal variance. They need not be independent, identically distributed or normal.

A linear estimator of bb is b~=Cy\tilde b = Cy, where the p×np \times n matrix CC may depend on XX but not on yy. It is unbiased if E[b~∣X]=b\mathbb{E}[\tilde b \mid X] = b for every b∈Rpb \in \mathbb{R}^p. Let b^=(X⊤X)−1X⊤y\hat b = (X^\top X)^{-1}X^\top y be the least squares estimator. Then:

  1. b^\hat b is linear and unbiased, with Var⁡(b^∣X)=σ2(X⊤X)−1\operatorname{Var}(\hat b \mid X) = \sigma^2(X^\top X)^{-1}.
  2. Best in the matrix order. For every linear unbiased b~\tilde b, the matrix Var⁡(b~∣X)−Var⁡(b^∣X)\operatorname{Var}(\tilde b \mid X) - \operatorname{Var}(\hat b \mid X) is positive semidefinite.
  3. Best and unique for every linear function. For every c∈Rpc \in \mathbb{R}^p, c⊤b^c^\top\hat b has the smallest variance among linear unbiased estimators of c⊤bc^\top b, and any linear unbiased estimator of c⊤bc^\top b with that variance equals c⊤b^c^\top\hat b.

If XX is random, the same order holds for the unconditional covariance matrices whenever E[(X⊤X)−1]\mathbb{E}[(X^\top X)^{-1}] is finite.

In plain words

You want to estimate the slope of a straight-line law from noisy measurements, using a weighted sum of the measurements. You ask for a recipe that is right on average whatever the true line is. Many recipes do this: for example, take the last measurement minus the first and divide by the distance between them. Among all of them, least squares scatters least around the truth, provided the measurement errors average to zero, do not move together, and all have the same spread. The bell curve is not needed. If you allow recipes that are wrong on average, or recipes that are not weighted sums and use a known shape of the errors, you can sometimes beat least squares.

Proof

Part 1. b^=Ay\hat b = Ay with A=(X⊤X)−1X⊤A = (X^\top X)^{-1}X^\top, which exists because XX has rank pp, so X⊤XX^\top X is positive definite. E[b^∣X]=AXb=b\mathbb{E}[\hat b \mid X] = AXb = b. Var⁡(b^∣X)=A(σ2I)A⊤=σ2(X⊤X)−1X⊤X(X⊤X)−1=σ2(X⊤X)−1\operatorname{Var}(\hat b \mid X) = A(\sigma^2 I)A^\top = \sigma^2(X^\top X)^{-1}X^\top X(X^\top X)^{-1} = \sigma^2(X^\top X)^{-1}.

Unbiasedness of a linear estimator. E[Cy∣X]=CXb\mathbb{E}[Cy \mid X] = CXb. This equals bb for every bb if and only if CX=IpCX = I_p: take bb to be each unit vector in turn.

Part 2. Let CyCy be linear and unbiased, and write C=A+DC = A + D. Then I=CX=AX+DX=I+DXI = CX = AX + DX = I + DX, so DX=0DX = 0, and also AD⊤=(X⊤X)−1(DX)⊤=0AD^\top = (X^\top X)^{-1}(DX)^\top = 0. Hence

Var⁡(Cy∣X)=σ2CC⊤=σ2(AA⊤+AD⊤+DA⊤+DD⊤)=σ2(X⊤X)−1+σ2DD⊤.\operatorname{Var}(Cy \mid X) = \sigma^2CC^\top = \sigma^2(AA^\top + AD^\top + DA^\top + DD^\top) = \sigma^2(X^\top X)^{-1} + \sigma^2DD^\top.

The difference from Var⁡(b^∣X)\operatorname{Var}(\hat b \mid X) is σ2DD⊤\sigma^2DD^\top, and c⊤DD⊤c=∥D⊤c∥2≥0c^\top DD^\top c = \lVert D^\top c\rVert^2 \ge 0 for every cc, so it is positive semidefinite.

Part 3. A linear estimator a⊤ya^\top y of c⊤bc^\top b is unbiased for every bb if and only if X⊤a=cX^\top a = c, by the same argument. Let H=X(X⊤X)−1X⊤H = X(X^\top X)^{-1}X^\top, the hat matrix, which is the orthogonal projection onto the column space of XX. Write a=Ha+(I−H)aa = Ha + (I - H)a. The first part is a∗=Ha=X(X⊤X)−1X⊤a=X(X⊤X)−1ca_\ast = Ha = X(X^\top X)^{-1}X^\top a = X(X^\top X)^{-1}c, the same for every admissible aa, and a∗⊤y=c⊤(X⊤X)−1X⊤y=c⊤b^a_\ast^\top y = c^\top(X^\top X)^{-1}X^\top y = c^\top\hat b. The two parts are orthogonal, so

Var⁡(a⊤y∣X)=σ2∥a∥2=σ2∥a∗∥2+σ2∥(I−H)a∥2=Var⁡(c⊤b^∣X)+σ2∥(I−H)a∥2.\operatorname{Var}(a^\top y \mid X) = \sigma^2\lVert a\rVert^2 = \sigma^2\lVert a_\ast\rVert^2 + \sigma^2\lVert(I - H)a\rVert^2 = \operatorname{Var}(c^\top\hat b \mid X) + \sigma^2\lVert(I - H)a\rVert^2.

So Var⁡(a⊤y∣X)≥Var⁡(c⊤b^∣X)\operatorname{Var}(a^\top y \mid X) \ge \operatorname{Var}(c^\top\hat b \mid X), with equality if and only if (I−H)a=0(I - H)a = 0, that is, a=a∗a = a_\ast, so the estimator is c⊤b^c^\top\hat b. (Part 2 also follows from part 3 by taking a=C⊤ca = C^\top c for each cc.)

Random XX. If b~\tilde b is conditionally unbiased, then by the law of total variance Var⁡(b~)=E[Var⁡(b~∣X)]+Var⁡(E[b~∣X])=E[Var⁡(b~∣X)]\operatorname{Var}(\tilde b) = \mathbb{E}[\operatorname{Var}(\tilde b \mid X)] + \operatorname{Var}(\mathbb{E}[\tilde b \mid X]) = \mathbb{E}[\operatorname{Var}(\tilde b \mid X)], because E[b~∣X]=b\mathbb{E}[\tilde b \mid X] = b is constant. The same holds for b^\hat b, and the expectation of a positive semidefinite matrix is positive semidefinite. ■\blacksquare

The proof uses only the first two moments of ε\varepsilon. Normality enters nowhere.

Consequences

  • Predictions and fitted values. For any point x0x_0, x0⊤b^x_0^\top\hat b is the BLUE of the mean response x0⊤bx_0^\top b. Every fitted value is BLUE for its mean, and Var⁡(y^∣X)=σ2H\operatorname{Var}(\hat y \mid X) = \sigma^2H.
  • Scalar summaries. The matrix order implies the order of every monotone summary: the total variance tr⁡Var⁡(b~)\operatorname{tr}\operatorname{Var}(\tilde b), the generalized variance det⁡Var⁡(b~)\det\operatorname{Var}(\tilde b) and the mean squared prediction error over any set of points are all smallest for b^\hat b within the linear unbiased class.
  • Rank-deficient designs. If XX has rank r<pr < p, bb itself has no unbiased estimator, but every estimable function c⊤bc^\top b, with cc in the row space of XX, has the BLUE c⊤b^c^\top\hat b for any least squares solution b^\hat b. This is the form used for analysis of variance models.
  • Correlated errors (Aitken). If Var⁡(ε∣X)=σ2Σ\operatorname{Var}(\varepsilon \mid X) = \sigma^2\Sigma with Σ\Sigma known and positive definite, apply the theorem to Σ−1/2y=Σ−1/2Xb+Σ−1/2ε\Sigma^{-1/2}y = \Sigma^{-1/2}Xb + \Sigma^{-1/2}\varepsilon, whose errors are spherical. The BLUE is the generalized least squares estimator (X⊤Σ−1X)−1X⊤Σ−1y(X^\top\Sigma^{-1}X)^{-1}X^\top\Sigma^{-1}y, with covariance σ2(X⊤Σ−1X)−1\sigma^2(X^\top\Sigma^{-1}X)^{-1}. With a diagonal Σ\Sigma this is weighted least squares.
  • Normal errors. If in addition ε∼N(0,σ2I)\varepsilon \sim N(0, \sigma^2I), then (X⊤y,∥y∥2)(X^\top y, \lVert y\rVert^2) is a complete sufficient statistic, and by the Lehmann-Scheffé theorem c⊤b^c^\top\hat b is the minimum variance unbiased estimator among all unbiased estimators, linear or not. It also reaches the Cramér-Rao bound.
  • The residual variance. Under the same three conditions, s2=∥y−Xb^∥2/(n−p)s^2 = \lVert y - X\hat b\rVert^2/(n - p) is unbiased for σ2\sigma^2, since E∥(I−H)ε∥2=σ2tr⁡(I−H)=σ2(n−p)\mathbb{E}\lVert(I - H)\varepsilon\rVert^2 = \sigma^2\operatorname{tr}(I - H) = \sigma^2(n - p). So s2(X⊤X)−1s^2(X^\top X)^{-1} is an unbiased estimate of Var⁡(b^∣X)\operatorname{Var}(\hat b \mid X), which is what the usual standard errors use.

Tightness

A linear unbiased competitor that loses. With x=(1,2,3,4,5)x = (1, 2, 3, 4, 5), the endpoint slope (y5−y1)/4(y_5 - y_1)/4 is linear and unbiased for the slope, with variance 2σ2/16=0.125σ22\sigma^2/16 = 0.125\sigma^2. The least squares slope has variance σ2/Sxx=σ2/10=0.1σ2\sigma^2/S_{xx} = \sigma^2/10 = 0.1\sigma^2. The theorem says that no choice of weights can go below 0.1σ20.1\sigma^2.

Linearity is needed when the error law is known. Let yi=μ+εiy_i = \mu + \varepsilon_i with εi\varepsilon_i iid uniform on [−12,12][-\tfrac12, \tfrac12], so X=1X = \mathbf 1 and b^=yˉ\hat b = \bar y, with variance 1/(12n)1/(12n). The midrange 12(min⁡iyi+max⁡iyi)\frac12(\min_i y_i + \max_i y_i) is unbiased for μ\mu (by symmetry) and has variance 1/(2(n+1)(n+2))1/(2(n + 1)(n + 2)). For n=10n = 10 that is 0.003790.00379 against 0.008330.00833 for the mean, and the ratio tends to 0 as nn grows. The midrange is not linear, and it is unbiased only because the error law is symmetric. Hansen (2022) argued that "linear" can be dropped if unbiasedness is required for every error distribution with the stated moments; Pötscher and Preinerstorfer (2024) showed that this class of estimators is the same as in the classical theorem. Dropping "linear" while keeping unbiasedness only for one error law is false, as the midrange shows.

Unbiasedness is needed. Ridge regression, (X⊤X+λI)−1X⊤y(X^\top X + \lambda I)^{-1}X^\top y, is linear but biased. Hoerl and Kennard (1970) showed that for every bb and σ2\sigma^2 some λ>0\lambda > 0 gives a smaller total mean squared error than least squares. For p≥3p \ge 3 coefficients with normal errors, the James-Stein estimator, which is neither linear nor unbiased, has smaller total mean squared error than b^\hat b for every bb (with the error measured in the metric of X⊤XX^\top X). So "best" is only within the class.

Equal variances are needed. Let x=(1,2,3,4,5)x = (1, 2, 3, 4, 5) and Var⁡(εi)=xi2\operatorname{Var}(\varepsilon_i) = x_i^2, uncorrelated. The least squares slope is still unbiased, with variance ∑i(xi−xˉ)2xi2/Sxx2=124/100=1.24\sum_i (x_i - \bar x)^2x_i^2/S_{xx}^2 = 124/100 = 1.24. Weighted least squares with weights 1/xi21/x_i^2 has variance 5269/7576=0.69555269/7576 = 0.6955, 44% less. See heteroscedasticity.

Uncorrelatedness is needed, but not exactly. Kruskal (1968) showed that, for a general error covariance σ2Σ\sigma^2\Sigma, least squares is still BLUE if and only if Σ\Sigma maps the column space of XX into itself. For example, equicorrelated errors, Σ=(1−ρ)I+ρ11⊤\Sigma = (1 - \rho)I + \rho\mathbf 1\mathbf 1^\top with −1/(n−1)<ρ<1-1/(n - 1) < \rho < 1, leave least squares BLUE in any model with an intercept, since Σx=(1−ρ)x+ρ(1⊤x)1\Sigma x = (1 - \rho)x + \rho(\mathbf 1^\top x)\mathbf 1 stays in the column space. So condition 3 is sufficient but not necessary.

Zero mean is needed. If E[ε∣X]≠0\mathbb{E}[\varepsilon \mid X] \ne 0, for example when a relevant predictor is omitted and correlated with the included ones, or when a predictor is measured with error, b^\hat b is biased, and the theorem says nothing.

History

Gauss first justified least squares in 1809 by assuming normal errors. In the Theoria combinationis observationum erroribus minimis obnoxiae, presented in two parts in 1821 and 1823, he dropped that assumption and proved that, for any error law with mean 0 and finite variance, least squares gives the linear unbiased combination of the observations with the least mean squared error; this is the theorem in its scalar form. Andrei Markov presented the result in his probability textbook (first edition 1900, second 1908). Jerzy Neyman, in 1934, called it Markov's theorem, which gave the name its second half; Plackett's 1949 note set out Gauss's priority. Alexander Aitken gave the matrix statement and the extension to correlated errors with a known covariance in 1935. Kruskal's 1968 coordinate-free paper settled when least squares and the Aitken estimator coincide.

References

  1. Carl Friedrich Gauss, Theory of the Combination of Observations Least Subject to Errors, translated by G. W. Stewart, SIAM Classics in Applied Mathematics 11, 1995, Part One and Part Two of the Theoria combinationis (1821 and 1823), where least squares is shown to give the linear unbiased combination of least mean squared error for any error law
  2. A. C. Aitken, On least squares and linear combination of observations, Proceedings of the Royal Society of Edinburgh 55, 1935, pp. 42 to 48, The whole paper (the matrix form of the theorem and the generalized least squares estimator for correlated errors)
  3. R. L. Plackett, A historical note on the method of least squares, Biometrika 36(3/4), 1949, pp. 458 to 460, The whole note (Gauss's 1821 to 1823 proof, Markov's textbook account and the name)
  4. George A. F. Seber and Alan J. Lee, Linear Regression Analysis, second edition, Wiley, 2003, Chapter 3 (least squares estimation, the Gauss-Markov theorem and its generalization to correlated errors)
  5. William Kruskal, When are Gauss-Markov and least squares estimators identical? A coordinate-free approach, Annals of Mathematical Statistics 39(1), 1968, pp. 70 to 75, The whole paper (least squares is best linear unbiased under a general covariance if and only if the covariance maps the column space of X into itself)
  6. Benedikt M. Pötscher and David Preinerstorfer, A comment on: A modern Gauss-Markov theorem, Econometrica 92(3), 2024, pp. 913 to 924, The whole comment (the version of Hansen 2022 without the word linear covers the same estimators as the classical Aitken theorem)

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/4143Z0/text.yaml