The Gauss-Markov Theorem

Suppose you fit a line through noisy data by Linear Regression and Least Squares. You minimized a sum of squares because it seemed the natural thing to do. But why should that particular criterion produce a good estimator, and good in what sense? The Gauss–Markov theorem answers this precisely. Among all estimators that are linear in the observed responses and unbiased for the true regression coefficients, the ordinary least squares (OLS) estimator has the smallest variance. This holds coordinate by coordinate and in every linear combination of coordinates. This is not an asymptotic statement. It requires no assumption of normality. It is an exact, finite-sample fact. It rests only on the linearity of the model and two moment conditions on the errors. The result matters because it converts an aesthetic or computational choice (minimize squared error) into an optimality certificate. It tells an analyst exactly what she is buying when she runs OLS. Not the smallest possible variance among all unbiased estimators. Rather, the smallest variance among the much larger and more tractable class of linear unbiased estimators. Hence the acronym BLUE, best linear unbiased estimator. It is essential to understand the precise scope of this guarantee. It is also essential to understand the assumptions it silently leans on. These are: linearity of the model, zero-mean errors, common variance, uncorrelated errors. But not normality, and not known variance. Knowing these lets you judge when least squares is the right tool, and when it is not. The big picture is a competition among estimators. Fix the design matrix and the true coefficient vector. Consider every rule that takes the data vector, applies a fixed linear transformation, and outputs an estimate of the coefficients. The rule must be correct on average, no matter the true coefficients. OLS is one such rule. The theorem asserts that OLS wins this competition outright. For every other linear unbiased rule, and every linear combination of coefficients, this holds. OLS's estimator of that combination has variance no larger. It is typically strictly smaller, unless the two estimators coincide. This article gives the model and hypotheses precisely. It proves the theorem in full using a "add and subtract" covariance argument. It works two asymmetric numerical examples: simple regression with heteroscedastic-looking design, and a case with a genuinely non-OLS linear unbiased competitor. It also shows, via explicit counterexample, why the uncorrelated-equal-variance assumption cannot be dropped.

Key takeaways
  • The linear model is Y=Xβ+εY = X\beta + \varepsilon with E[ε]=0\mathbb{E}[\varepsilon] = 0 and Cov(ε)=σ2I\mathrm{Cov}(\varepsilon) = \sigma^2 I.
  • Under these assumptions, the OLS estimator β^=(X⊤X)−1X⊤Y\hat\beta = (X^\top X)^{-1}X^\top Y is unbiased for β\beta.
  • Among all estimators linear in YY and unbiased for β\beta, OLS minimizes variance in every direction: Var(c⊤β^)≤Var(c⊤β~)\mathrm{Var}(c^\top\hat\beta) \le \mathrm{Var}(c^\top\tilde\beta) for any linear unbiased β~\tilde\beta and any vector cc.
  • No distributional assumption (e.g. normality) is needed; normality is only needed for exact finite-sample confidence intervals and tt/FF-tests, not for BLUE-ness.
  • Dropping the equal-variance/uncorrelated-errors assumption breaks the theorem: another linear unbiased estimator (e.g. weighted least squares) can strictly beat OLS.
  • Key idea: unbiasedness plus linearity plus a covariance decomposition forces every competing linear unbiased estimator's variance to equal OLS's variance plus a nonnegative extra term.

Where this lives today

The Gauss–Markov theorem underlies the standard justification for ordinary least squares in econometrics, where it licenses OLS as the default estimator whenever errors are plausibly homoscedastic and uncorrelated, and motivates diagnostic testing (for heteroscedasticity, autocorrelation) precisely because violations break the BLUE guarantee. In experimental design and analysis of variance, the same linear-model framework and theorem justify treatment-effect estimators in randomized experiments. In signal processing and control theory, the theorem is the static-in-time special case of the Kalman filter's optimality proof, where the recursive linear estimator is shown to be the minimum-variance linear unbiased estimator of a dynamically evolving state given noisy measurements. In geodesy and surveying — Gauss's own original application — least-squares adjustment of over-determined measurement networks (leveling networks, GPS trilateration) still invokes this exact variance-optimality argument. In numerical linear algebra and machine learning, the theorem is the benchmark against which regularized estimators (ridge regression, LASSO) are compared: those methods deliberately introduce bias to reduce variance beyond what Gauss–Markov permits within the unbiased class, and understanding why they can beat OLS in mean squared error requires first understanding exactly what Gauss–Markov does and does not promise.

Ask the tutor: How does the Gauss–Markov theorem change if we use Generalized Least Squares instead of OLS?

DefinitionThe Gauss–Markov linear model

Let n≥pn \ge p and consider observed data Y∈RnY \in \mathbb{R}^n generated by

Y=Xβ+ε,Y = X\beta + \varepsilon,

where:

  • XX is a fixed (non-random, "design") n×pn \times p matrix of full column rank pp, known to the statistician;
  • β∈Rp\beta \in \mathbb{R}^p is an unknown fixed parameter vector;
  • ε∈Rn\varepsilon \in \mathbb{R}^n is an unobserved random error vector satisfying
E[ε]=0,Cov(ε)=σ2In\mathbb{E}[\varepsilon] = 0, \qquad \mathrm{Cov}(\varepsilon) = \sigma^2 I_n

for some unknown σ2>0\sigma^2 > 0 (i.e. errors have mean zero, common variance σ2\sigma^2, and are pairwise uncorrelated). No assumption of normality, or of independence beyond uncorrelatedness, is imposed. An estimator β~\tilde\beta of β\beta is called:

  • linear if β~=AY\tilde\beta = AY for some fixed (non-random) matrix A∈Rp×nA \in \mathbb{R}^{p \times n}, possibly depending on XX but not on YY or β\beta;
  • unbiased if Eβ[β~]=β\mathbb{E}_\beta[\tilde\beta] = \beta for every β∈Rp\beta \in \mathbb{R}^p.

The ordinary least squares estimator is

β^=(X⊤X)−1X⊤Y,\hat\beta = (X^\top X)^{-1} X^\top Y,

which is well-defined since XX has full column rank (so X⊤XX^\top X is invertible).

Intuition

Think of β^\hat\beta as one particular linear rule for reading off coefficients from data, built from the matrix A0=(X⊤X)−1X⊤A_0 = (X^\top X)^{-1}X^\top. There are infinitely many other linear rules β~=AY\tilde\beta = AY; the unbiasedness constraint E[AY]=AXβ=β\mathbb{E}[AY] = A X\beta = \beta for all β\beta forces AX=IpAX = I_p, which is a strong linear constraint on AA but still leaves an entire affine family of valid matrices (any AA of the form A0+DA_0 + D where DX=0DX = 0). Each such AA defines a legitimate unbiased linear estimator, and the theorem says that padding A0A_0 with any nonzero "DD satisfying DX=0DX=0" can only inflate variance, never shrink it. Geometrically, DX=0D X = 0 means the rows of DD live in the orthogonal complement (with respect to the ordinary inner product on Rn\mathbb{R}^n) of the column space of XX — the same subspace that contains the OLS residuals. Adding such a DD to A0A_0 injects "extra noise" that is uncorrelated with the useful signal captured by A0A_0, and uncorrelated terms add variance rather than cancel it. This is exactly the Pythagorean-like decomposition the proof makes precise.

Figure
The competing linear-unbiased estimator sits perpendicular to the OLS row space
col(X) col(X)⊥ A₀ = (XᵀX)⁻¹Xᵀ (row of) D (DX = 0) A = A₀ + D Var(AY) = Var(A₀Y) + Var(DY) ≥ Var(A₀Y)

The central theorem

TheoremGauss–Markov

Consider the linear model of the Definition above: Y=Xβ+εY = X\beta + \varepsilon, XX fixed of full column rank pp, E[ε]=0\mathbb{E}[\varepsilon]=0, Cov(ε)=σ2In\mathrm{Cov}(\varepsilon) = \sigma^2 I_n, σ2∈(0,∞)\sigma^2 \in (0,\infty) unknown. Let

β^=(X⊤X)−1X⊤Y\hat\beta = (X^\top X)^{-1}X^\top Y

be the OLS estimator. Let β~=AY\tilde\beta = AY be any linear unbiased estimator of β\beta (i.e. A∈Rp×nA \in \mathbb{R}^{p\times n} fixed with AX=IpAX = I_p). Then for every fixed vector c∈Rpc \in \mathbb{R}^p,

Var(c⊤β^)  ≤  Var(c⊤β~),\mathrm{Var}(c^\top \hat\beta) \;\le\; \mathrm{Var}(c^\top \tilde\beta),

with equality for all cc if and only if A=(X⊤X)−1X⊤A = (X^\top X)^{-1}X^\top almost surely in the sense that AY=β^AY = \hat\beta with probability 1 (equivalently, D:=A−(X⊤X)−1X⊤D:=A - (X^\top X)^{-1}X^\top satisfies D Cov(ε)D⊤=0D\,\mathrm{Cov}(\varepsilon)D^\top = 0, which under Cov(ε)=σ2I\mathrm{Cov}(\varepsilon)=\sigma^2I with σ2>0\sigma^2>0 forces D=0D=0). Equivalently, in the Loewner (positive semidefinite) order on covariance matrices,

Cov(β~)−Cov(β^)  ⪰  0.\mathrm{Cov}(\tilde\beta) - \mathrm{Cov}(\hat\beta) \;\succeq\; 0.

That is, β^\hat\beta is the Best Linear Unbiased Estimator (BLUE) of β\beta.

LemmaUnbiasedness constraint

A linear estimator β~=AY\tilde\beta = AY (with AA a fixed matrix not depending on β\beta) is unbiased for β\beta for every β∈Rp\beta \in \mathbb{R}^p if and only if AX=IpAX = I_p.

Proof

Technique: direct computation of expectation, then a linear-algebra identification argument. Using Y=Xβ+εY = X\beta + \varepsilon and linearity of expectation,

E[AY]=A E[Xβ+ε]=AXβ+A E[ε]=AXβ,\mathbb{E}[AY] = A\,\mathbb{E}[X\beta + \varepsilon] = AX\beta + A\,\mathbb{E}[\varepsilon] = AX\beta,

since E[ε]=0\mathbb{E}[\varepsilon] = 0 by hypothesis. Unbiasedness for every β∈Rp\beta \in \mathbb{R}^p means

AXβ=βfor all β∈Rp,AX\beta = \beta \quad \text{for all } \beta \in \mathbb{R}^p,

i.e. (AX−Ip)β=0(AX - I_p)\beta = 0 for all β\beta, which holds if and only if the matrix AX−IpAX - I_p is the zero matrix (apply it to each standard basis vector eje_j to recover column jj). Hence unbiasedness for all β\beta is equivalent to AX=IpAX = I_p. ■\blacksquare

∎
Proof

Proof of the Gauss–Markov theorem. Technique: "add and subtract" decomposition plus the covariance/Loewner-order argument; non-circular — uses only the definitions of variance, covariance, and the Lemma just proved, never the theorem itself.

Step 1: Set up the deviation matrix. Let β~=AY\tilde\beta = AY be any linear unbiased estimator of β\beta. By the Lemma, unbiasedness is equivalent to AX=IpAX = I_p. Define

D:=A−(X⊤X)−1X⊤,D := A - (X^\top X)^{-1}X^\top,

so that A=(X⊤X)−1X⊤+DA = (X^\top X)^{-1}X^\top + D. We first show DX=0DX = 0:

DX=AX−(X⊤X)−1X⊤X=Ip−Ip=0,DX = AX - (X^\top X)^{-1}X^\top X = I_p - I_p = 0,

using AX=IpAX = I_p (unbiasedness of β~\tilde\beta) and the trivial identity (X⊤X)−1X⊤X=Ip(X^\top X)^{-1}X^\top X = I_p (unbiasedness of OLS itself, which is the special case D=0D = 0).

Step 2: Compute the covariance matrix of β~\tilde\beta. Since Y=Xβ+εY = X\beta + \varepsilon is an affine function of the random vector ε\varepsilon with fixed XβX\beta, we have β~=AY=AXβ+Aε=β+Aε\tilde\beta = AY = AX\beta + A\varepsilon = \beta + A\varepsilon (using AX=IpAX=I_p). Covariance is invariant under adding a constant vector, so

Cov(β~)=Cov(Aε)=A Cov(ε) A⊤=σ2AA⊤,\mathrm{Cov}(\tilde\beta) = \mathrm{Cov}(A\varepsilon) = A\,\mathrm{Cov}(\varepsilon)\,A^\top = \sigma^2 A A^\top,

using the standard identity Cov(Mε)=M Cov(ε) M⊤\mathrm{Cov}(M\varepsilon) = M\,\mathrm{Cov}(\varepsilon)\,M^\top for a fixed matrix MM, and the hypothesis Cov(ε)=σ2In\mathrm{Cov}(\varepsilon) = \sigma^2 I_n. Substitute A=(X⊤X)−1X⊤+DA = (X^\top X)^{-1}X^\top + D and write B:=(X⊤X)−1X⊤B := (X^\top X)^{-1}X^\top for brevity, so A=B+DA = B + D:

AA⊤=(B+D)(B+D)⊤=BB⊤+BD⊤+DB⊤+DD⊤.AA^\top = (B+D)(B+D)^\top = BB^\top + BD^\top + DB^\top + DD^\top.

Now compute BD⊤BD^\top. We have DX=0DX = 0 from Step 1, hence transposing, X⊤D⊤=0X^\top D^\top = 0, so

BD⊤=(X⊤X)−1X⊤D⊤=(X⊤X)−1(X⊤D⊤)=(X⊤X)−1⋅0=0.BD^\top = (X^\top X)^{-1}X^\top D^\top = (X^\top X)^{-1}\big(X^\top D^\top\big) = (X^\top X)^{-1} \cdot 0 = 0.

Symmetrically DB⊤=(BD⊤)⊤=0⊤=0DB^\top = (BD^\top)^\top = 0^\top = 0. Therefore the cross terms vanish and

AA⊤=BB⊤+DD⊤.AA^\top = BB^\top + DD^\top.

Consequently

Cov(β~)=σ2AA⊤=σ2BB⊤+σ2DD⊤=Cov(β^)+σ2DD⊤,\mathrm{Cov}(\tilde\beta) = \sigma^2 AA^\top = \sigma^2 BB^\top + \sigma^2 DD^\top = \mathrm{Cov}(\hat\beta) + \sigma^2 DD^\top,

where we used that Cov(β^)=σ2BB⊤\mathrm{Cov}(\hat\beta) = \sigma^2 BB^\top by the same covariance identity applied to β^=BY\hat\beta = BY (this is the D=0D=0 case, so it is consistent, not an extra assumption).

Step 3: The extra term is positive semidefinite. For any fixed vector c∈Rpc \in \mathbb{R}^p, the scalar c⊤DD⊤c=(D⊤c)⊤(D⊤c)=∥D⊤c∥22≥0c^\top DD^\top c = (D^\top c)^\top (D^\top c) = \|D^\top c\|_2^2 \ge 0, since it is the squared Euclidean norm of the vector D⊤c∈RnD^\top c \in \mathbb{R}^n. Hence DD⊤DD^\top is a positive semidefinite matrix, i.e. DD⊤⪰0DD^\top \succeq 0, and since σ2>0\sigma^2 > 0, also σ2DD⊤⪰0\sigma^2 DD^\top \succeq 0.

Step 4: Conclude variance comparison. For any fixed c∈Rpc \in \mathbb{R}^p,

Var(c⊤β~)=c⊤Cov(β~) c=c⊤Cov(β^) c+σ2c⊤DD⊤c=Var(c⊤β^)+σ2∥D⊤c∥22≥Var(c⊤β^),\mathrm{Var}(c^\top \tilde\beta) = c^\top \mathrm{Cov}(\tilde\beta)\, c = c^\top \mathrm{Cov}(\hat\beta)\, c + \sigma^2 c^\top DD^\top c = \mathrm{Var}(c^\top \hat\beta) + \sigma^2 \|D^\top c\|_2^2 \ge \mathrm{Var}(c^\top\hat\beta),

which is the claimed inequality. This also proves the matrix statement Cov(β~)−Cov(β^)=σ2DD⊤⪰0\mathrm{Cov}(\tilde\beta) - \mathrm{Cov}(\hat\beta) = \sigma^2 DD^\top \succeq 0, i.e. the Loewner order claim.

Step 5: Equality case. Equality Var(c⊤β~)=Var(c⊤β^)\mathrm{Var}(c^\top\tilde\beta) = \mathrm{Var}(c^\top\hat\beta) for a particular cc holds iff σ2∥D⊤c∥22=0\sigma^2\|D^\top c\|_2^2 = 0, i.e. (since σ2>0\sigma^2>0) iff D⊤c=0D^\top c = 0. Equality for every c∈Rpc \in \mathbb{R}^p forces D⊤c=0D^\top c = 0 for all cc, hence D⊤=0D^\top = 0, hence D=0D = 0, hence A=B=(X⊤X)−1X⊤A = B = (X^\top X)^{-1}X^\top, i.e. β~=β^\tilde\beta = \hat\beta with probability 1 (they are the same linear function of YY). Conversely if D=0D=0 equality trivially holds for every cc. This establishes the equality characterization. ■\blacksquare

∎
CorollaryBest linear unbiased estimator of any estimable linear functional

For any fixed vector c∈Rpc \in \mathbb{R}^p, among all linear unbiased estimators t⊤Yt^\top Y of the scalar c⊤βc^\top\beta (meaning t∈Rnt \in \mathbb{R}^n fixed with E[t⊤Y]=c⊤β\mathbb{E}[t^\top Y] = c^\top\beta for all β\beta), the estimator c⊤β^c^\top\hat\beta has the smallest variance.

Proof

Technique: reduction to the theorem via the row-space characterization of unbiased linear functionals. If t⊤Yt^\top Y is unbiased for c⊤βc^\top\beta for all β\beta, then E[t⊤Y]=t⊤Xβ=c⊤β\mathbb{E}[t^\top Y] = t^\top X\beta = c^\top \beta for all β\beta, forcing X⊤t=cX^\top t = c (same basis-vector argument as the Lemma). One can always extend t⊤t^\top to a full unbiased matrix AA with c⊤c^\top as one row: concretely, take A=(X⊤X)−1X⊤+DA = (X^\top X)^{-1}X^\top + D for suitable DD with DX=0DX=0 and D⊤c′=t−BcD^\top c' = t - Bc for the target row — more directly, apply Step 1–4 of the theorem's proof to the single linear combination c⊤βc^\top\beta estimated by t⊤Yt^\top Y, noting the proof of the theorem never used more than one row of AA at a time (the argument was carried out for a fixed vector cc throughout). Hence Var(t⊤Y)≥Var(c⊤β^)\mathrm{Var}(t^\top Y) \ge \mathrm{Var}(c^\top \hat\beta) by exactly the computation of Steps 2–4 with AA replaced by the row vector t⊤t^\top and cc replaced by the standard functional evaluated at that row. ■\blacksquare

∎

Worked examples

Example 1 — Simple linear regression with an asymmetric design, comparing OLS to the sample-mean-of-slopes competitor. Consider n=4n = 4 observations of a simple regression Yi=β0+β1xi+εiY_i = \beta_0 + \beta_1 x_i + \varepsilon_i with design points

x1=0, x2=1, x3=3, x4=8,x_1 = 0,\ x_2 = 1,\ x_3 = 3,\ x_4 = 8,

deliberately unequally spaced (asymmetric) so that no cancellation simplifies the algebra. Assume Cov(ε)=σ2I4\mathrm{Cov}(\varepsilon) = \sigma^2 I_4 with σ2=2\sigma^2 = 2. The design matrix is

X=(10111318).X = \begin{pmatrix} 1 & 0 \\ 1 & 1 \\ 1 & 3 \\ 1 & 8 \end{pmatrix}.

Compute

X⊤X=(4121274),det⁡(X⊤X)=4⋅74−122=296−144=152.X^\top X = \begin{pmatrix} 4 & 12 \\ 12 & 74 \end{pmatrix}, \qquad \det(X^\top X) = 4\cdot 74 - 12^2 = 296 - 144 = 152.

So

(X⊤X)−1=1152(74−12−124).(X^\top X)^{-1} = \frac{1}{152}\begin{pmatrix} 74 & -12 \\ -12 & 4 \end{pmatrix}.

The OLS estimator of β1\beta_1 (the slope) has row vector

b⊤=[(X⊤X)−1X⊤]row 2=1152(−12, 4) X⊤=1152(−12(1,1,1,1)+4(0,1,3,8)).b^\top = \big[(X^\top X)^{-1}X^\top\big]_{\text{row }2} = \frac{1}{152}(-12,\,4)\, X^\top = \frac{1}{152}\big(-12(1,1,1,1) + 4(0,1,3,8)\big).

Compute entrywise: −12(1,1,1,1)=(−12,−12,−12,−12)-12(1,1,1,1) = (-12,-12,-12,-12) and 4(0,1,3,8)=(0,4,12,32)4(0,1,3,8) = (0,4,12,32). Sum:

b⊤=1152(−12, −8, 0, 20).b^\top = \frac{1}{152}(-12,\,-8,\,0,\,20).

Check unbiasedness-consistency: b⊤1=1152(−12−8+0+20)=0b^\top \mathbf{1} = \frac{1}{152}(-12-8+0+20) = 0 ✓ (intercept-orthogonality), and b⊤x=1152(−12⋅0−8⋅1+0⋅3+20⋅8)=1152(−8+160)=152152=1b^\top x = \frac{1}{152}(-12\cdot 0 -8\cdot1+0\cdot3+20\cdot8) = \frac{1}{152}(-8+160)=\frac{152}{152}=1 ✓, confirming b⊤X=(0,1)b^\top X = (0,1) as required for unbiasedly estimating β1\beta_1. Its variance (using Cov(ε)=σ2I\mathrm{Cov}(\varepsilon)=\sigma^2 I, so Var(b⊤Y)=σ2∥b∥22\mathrm{Var}(b^\top Y) = \sigma^2 \|b\|_2^2):

∥b∥22=11522(144+64+0+400)=6081522=60823104.\|b\|_2^2 = \frac{1}{152^2}\big(144 + 64 + 0 + 400\big) = \frac{608}{152^2} = \frac{608}{23104}.

Simplify: 608/23104=19/722608/23104 = 19/722 (dividing numerator and denominator by 32). So

Var(b⊤Y)=σ2⋅19722=2⋅19722=38722=19361=119.\mathrm{Var}(b^\top Y) = \sigma^2 \cdot \frac{19}{722} = 2\cdot\frac{19}{722} = \frac{38}{722} = \frac{19}{361} = \frac{1}{19}.

Indeed 361=192361 = 19^2, so Var(β^1)=119≈0.0526\mathrm{Var}(\hat\beta_1) = \dfrac{1}{19} \approx 0.0526.

A genuinely different linear unbiased competitor. Consider the two-point-slope estimator using only the two extreme observations:

β~1=Y4−Y1x4−x1=Y4−Y18.\tilde\beta_1 = \frac{Y_4 - Y_1}{x_4 - x_1} = \frac{Y_4 - Y_1}{8}.

This is linear in YY with weight vector t⊤=(−18,0,0,18)t^\top = (-\tfrac18, 0, 0, \tfrac18). Check unbiasedness: t⊤X=(−18+18, −18⋅0+18⋅8)=(0,1)t^\top X = (-\tfrac18+\tfrac18,\ -\tfrac18\cdot 0 + \tfrac18\cdot 8) = (0, 1) ✓, so E[β~1]=β1\mathbb{E}[\tilde\beta_1] = \beta_1 for all β\beta: it is a legitimate linear unbiased competitor. Its variance: Var(β~1)=σ2∥t∥22=2(164+164)=2⋅264=464=116=0.0625\mathrm{Var}(\tilde\beta_1) = \sigma^2\|t\|_2^2 = 2\left(\tfrac{1}{64}+\tfrac{1}{64}\right) = 2\cdot\tfrac{2}{64} = \tfrac{4}{64} = \tfrac{1}{16} = 0.0625. Compare: Var(β^1)=1/19≈0.05263<1/16=0.0625=Var(β~1)\mathrm{Var}(\hat\beta_1) = 1/19 \approx 0.05263 < 1/16 = 0.0625 = \mathrm{Var}(\tilde\beta_1), exactly as the theorem guarantees — OLS beats the two-point estimator, using information from all four points rather than only the extremes.

Example 2 — Verifying the exact decomposition Cov(β~)=Cov(β^)+σ2DD⊤\mathrm{Cov}(\tilde\beta)=\mathrm{Cov}(\hat\beta)+\sigma^2DD^\top numerically. Reuse the design above but now estimate the full vector β=(β0,β1)\beta=(\beta_0,\beta_1). Take the competitor to be OLS applied to only the last three points padded appropriately is awkward in vector form, so instead build an explicit DD satisfying DX=0DX=0 directly and confirm the variance inflation formula, which is the mechanism underlying the whole theorem. Since DX=0DX = 0 means each row of DD is orthogonal (dot product zero) to both columns of XX — i.e. orthogonal to 1=(1,1,1,1)⊤\mathbf{1} = (1,1,1,1)^\top and to x=(0,1,3,8)⊤x = (0,1,3,8)^\top — we need vectors in R4\mathbb{R}^4 orthogonal to both. The orthogonal complement of span{1,x}\mathrm{span}\{\mathbf 1, x\} in R4\mathbb{R}^4 is 2-dimensional. Find one such vector dd by solving d⋅1=0d\cdot\mathbf1=0, d⋅x=0d\cdot x=0. Try d=(a,b,c,e)d = (a,b,c,e) with

a+b+c+e=0,0a+1b+3c+8e=0.a+b+c+e=0,\qquad 0a+1b+3c+8e=0.

Pick e=0e=0, c=1c=1: then b=−3b=-3, and a=−b−c−e=3−1=2a = -b-c-e = 3-1=2. So d=(2,−3,1,0)d=(2,-3,1,0). Check: sum =2−3+1+0=0=2-3+1+0=0 ✓; weighted sum =0(2)+1(−3)+3(1)+8(0)=−3+3=0=0(2)+1(-3)+3(1)+8(0) = -3+3=0 ✓. Let DD be the 2×42\times4 matrix with first row d⊤=(2,−3,1,0)d^\top=(2,-3,1,0) scaled by a constant λ\lambda and second row zero (we perturb only the intercept-estimating row, to keep the slope estimator equal to OLS's and isolate the effect on the intercept):

D=(λ⋅2λ⋅(−3)λ⋅100000).D = \begin{pmatrix} \lambda\cdot 2 & \lambda\cdot(-3) & \lambda\cdot 1 & 0 \\ 0&0&0&0 \end{pmatrix}.

Then A=(X⊤X)−1X⊤+DA = (X^\top X)^{-1}X^\top + D still satisfies AX=I2AX = I_2 (since DX=0DX=0), so β~=AY\tilde\beta = AY is a valid linear unbiased estimator of (β0,β1)(\beta_0,\beta_1) for any λ∈R\lambda\in\mathbb{R}. The OLS row for the intercept is (first row of (X⊤X)−1X⊤(X^\top X)^{-1}X^\top):

a0⊤=1152(74,−12)X⊤=1152(74(1,1,1,1)−12(0,1,3,8))=1152(74, 62, 38, −22).a_0^\top = \frac{1}{152}(74,-12)X^\top = \frac{1}{152}\big(74(1,1,1,1) -12(0,1,3,8)\big) = \frac{1}{152}(74,\,62,\,38,\,-22).

Check: a0⊤1=(74+62+38−22)/152=152/152=1a_0^\top \mathbf1 = (74+62+38-22)/152 = 152/152=1 ✓; a0⊤x=(0+62+114−176)/152=0/152=0a_0^\top x = (0+62+114-176)/152 = 0/152=0 ✓, confirming this row correctly estimates β0\beta_0 unbiasedly. ∥a0∥22=(742+622+382+222)/1522=(5476+3844+1444+484)/23104=11248/23104\|a_0\|_2^2 = (74^2+62^2+38^2+22^2)/152^2 = (5476+3844+1444+484)/23104 = 11248/23104. Simplify: gcd⁡(11248,23104)\gcd(11248,23104). 11248=16⋅70311248 = 16\cdot703, 23104=16⋅144423104=16\cdot1444, so ratio =703/1444=703/1444. Since 1444=3821444=38^2 and 703=19⋅37703 = 19\cdot37, this doesn't reduce further nicely; numerically 703/1444≈0.48685703/1444 \approx 0.48685. So Var(β^0)=σ2⋅0.48685=2(0.48685)=0.9737\mathrm{Var}(\hat\beta_0) = \sigma^2\cdot 0.48685 = 2(0.48685)= 0.9737 (using σ2=2\sigma^2=2). Now the perturbed row is λd⊤+a0⊤\lambda d^\top + a_0^\top (rows add since DD's first row is λd⊤\lambda d^\top). Its squared norm:

∥λd+a0∥22=∥a0∥22+2λ d⊤a0+λ2∥d∥22.\|\lambda d + a_0\|_2^2 = \|a_0\|_2^2 + 2\lambda\, d^\top a_0 + \lambda^2\|d\|_2^2.

We already know from the general proof that the cross term d⊤a0d^\top a_0 must vanish (since DX=0DX=0 forces Ba0Ba_0-type cross terms to vanish row-wise too — let's verify directly): d⊤a0=1152(2⋅74+(−3)(62)+1⋅38+0⋅(−22))=1152(148−186+38+0)=0152=0.d^\top a_0 = \frac{1}{152}\big(2\cdot74 + (-3)(62) + 1\cdot 38 + 0\cdot(-22)\big) = \frac{1}{152}(148 -186+38+0) = \frac{0}{152}=0. ✓ Confirms the cross-term cancellation proved abstractly in Step 2 of the theorem's proof. ∥d∥22=4+9+1+0=14\|d\|_2^2 = 4+9+1+0=14. So

Var(β~0)=σ2(∥a0∥22+λ2⋅14)=Var(β^0)+14σ2λ2≥Var(β^0),\mathrm{Var}(\tilde\beta_0) = \sigma^2\big(\|a_0\|_2^2 + \lambda^2\cdot 14\big) = \mathrm{Var}(\hat\beta_0) + 14\sigma^2\lambda^2 \ge \mathrm{Var}(\hat\beta_0),

for every λ\lambda, with equality iff λ=0\lambda = 0, i.e. iff β~0=β^0\tilde\beta_0=\hat\beta_0 — exactly reproducing the theorem's conclusion and equality condition in a fully explicit numerical instance. For example at λ=0.1\lambda = 0.1: Var(β~0)=0.9737+14(2)(0.01)=0.9737+0.28=1.2537>0.9737\mathrm{Var}(\tilde\beta_0) = 0.9737 + 14(2)(0.01) = 0.9737+0.28=1.2537 > 0.9737.

CounterexampleWhy uncorrelated equal-variance errors cannot be dropped

Drop only the assumption Cov(ε)=σ2In\mathrm{Cov}(\varepsilon) = \sigma^2 I_n, replacing it with a known heteroscedastic covariance Cov(ε)=Σ\mathrm{Cov}(\varepsilon) = \Sigma where Σ\Sigma is diagonal but not a multiple of the identity — everything else in the model (linearity, E[ε]=0\mathbb{E}[\varepsilon]=0, fixed full-rank XX) is retained. We exhibit a linear unbiased estimator that strictly beats OLS in variance, so OLS is no longer BLUE. Take n=2n=2, p=1p=1, model Yi=βxi+εiY_i = \beta x_i + \varepsilon_i with x1=1,x2=1x_1=1, x_2=1 (so X=(1,1)⊤X = (1,1)^\top), and

Cov(ε)=Σ=(1009),\mathrm{Cov}(\varepsilon) = \Sigma = \begin{pmatrix}1 & 0\\ 0& 9\end{pmatrix},

i.e. Var(ε1)=1\mathrm{Var}(\varepsilon_1)=1, Var(ε2)=9\mathrm{Var}(\varepsilon_2)=9, uncorrelated but not equal variance. OLS estimator: β^=(X⊤X)−1X⊤Y=12(Y1+Y2)\hat\beta = (X^\top X)^{-1}X^\top Y = \tfrac12(Y_1+Y_2), weight vector b⊤=(12,12)b^\top=(\tfrac12,\tfrac12), unbiased since b⊤X=12+12=1b^\top X = \tfrac12+\tfrac12=1. Its variance:

Var(β^)=b⊤Σb=14(1)+14(9)=104=2.5.\mathrm{Var}(\hat\beta) = b^\top \Sigma b = \tfrac14(1) + \tfrac14(9) = \tfrac{10}{4} = 2.5.

Now consider the (generalized-least-squares-motivated) weighted estimator β~=w1Y1+w2Y2\tilde\beta = w_1Y_1+w_2Y_2 with weights inversely proportional to variance: w1=9/10, w2=1/10w_1 = 9/10,\ w_2=1/10 (so w1+w2=1w_1+w_2=1, ensuring unbiasedness since X1=X2=1X_1=X_2=1). This is linear (t⊤=(9/10,1/10)t^\top=(9/10,1/10)) and unbiased (t⊤X=9/10+1/10=1t^\top X = 9/10+1/10=1 ✓). Its variance:

Var(β~)=(910)2(1)+(110)2(9)=81100+9100=90100=0.9.\mathrm{Var}(\tilde\beta) = \left(\tfrac{9}{10}\right)^2(1) + \left(\tfrac1{10}\right)^2(9) = \tfrac{81}{100}+\tfrac{9}{100} = \tfrac{90}{100}=0.9.

Since 0.9<2.50.9 < 2.5, the weighted estimator β~\tilde\beta is a linear unbiased estimator with strictly smaller variance than OLS. This directly contradicts the conclusion of the Gauss–Markov theorem, showing that the hypothesis Cov(ε)=σ2In\mathrm{Cov}(\varepsilon)=\sigma^2 I_n (in particular, equal variances — homoscedasticity) is essential, not a mere convenience. (In fact this weighted estimator is exactly the Generalized Least Squares estimator (X⊤Σ−1X)−1X⊤Σ−1Y(X^\top\Sigma^{-1}X)^{-1}X^\top\Sigma^{-1}Y, which replaces OLS as BLUE once Σ≠σ2I\Sigma \ne \sigma^2I; this is the content of the Aitken generalization, mentioned here only to locate the counterexample, not proved.)

Scope, edge cases & common traps

SituationWhat Gauss–Markov does / does not say
Errors correlated or heteroscedastic (Cov(ε)≠σ2I\mathrm{Cov}(\varepsilon)\ne\sigma^2I)OLS is not guaranteed BLUE; see counterexample above; GLS is BLUE instead
Errors non-normal but i.i.d. with finite varianceOLS is still BLUE; theorem needs no normality anywhere
XX not full column rank(X⊤X)−1(X^\top X)^{-1} does not exist; OLS estimator of β\beta itself is not even defined (only certain linear combinations may be estimable)
Nonlinear (biased) competitors, e.g. ridge/James–Stein-type shrinkageTheorem says nothing — such estimators are not linear-unbiased and can have smaller variance or MSE by trading away unbiasedness
Small sample, want exact confidence intervalsRequires normality of ε\varepsilon in addition to Gauss–Markov assumptions; BLUE-ness alone gives no distributional guarantee
Random design XXTheorem as stated conditions on XX fixed; extends by conditioning arguments if ε⊥X\varepsilon\perp X with the same conditional moment structure

The mathematician behind it

Origins · 1 minCarl Friedrich Gauss and how this was discovered
CF
Carl Friedrich Gauss
1777–1855 · Göttingen, celestial mechanics and geodesy

Gauss derived the method of least squares in the 1790s–1800s while predicting the orbit of the asteroid Ceres from sparse astronomical observations, publishing the theory in Theoria Motus Corporum Coelestium (1809) and giving a variance-optimality justification in Theoria Combinationis Observationum Erroribus Minimis Obnoxiae (1821–1823) — essentially the theorem discussed here, decades before Andrei Markov's name became attached to it through twentieth-century textbook exposition of Gauss's argument in a modern algebraic form.

History
- 1795 — Gauss privately develops the method of least squares (later disputed priority with Legendre, who published first, in 1805).
- 1809 — Gauss publishes least squares applied to orbit determination in Theoria Motus.
- 1821–1823 — Gauss publishes the optimality theorem (minimum variance among linear unbiased estimators) in Theoria Combinationis.
- 1900 — Andrei Markov's lecture notes on probability restate and popularize the theorem in a form influential in the Russian probability school.
- 1934 — Jerzy Neyman and others formalize and disseminate the modern matrix statement, cementing the name "Gauss–Markov" in the English-language statistics literature.
Does Gauss–Markov require the errors to be independent, or just uncorrelated?

Only uncorrelated. The hypothesis is Cov(ε)=σ2In\mathrm{Cov}(\varepsilon) = \sigma^2 I_n, a statement purely about the second moments (variances and covariances) of the error vector. Independence is a strictly stronger condition (it constrains the entire joint distribution, not just covariances), and nothing in the proof uses more than the covariance matrix: the proof only ever multiplies matrices against Cov(ε)\mathrm{Cov}(\varepsilon). So two errors could be uncorrelated yet dependent (for instance, one could be a deterministic even function of the other under a symmetric distribution) and the theorem's conclusion would still hold exactly as stated, since only Cov(ε)=σ2I\mathrm{Cov}(\varepsilon)=\sigma^2I enters the argument.

Why isn't normality needed, if OLS equals the maximum likelihood estimator under normal errors?

Normality is needed to conclude that OLS is the MLE, or to build exact tt- and FF-tests and confidence intervals with guaranteed coverage in finite samples. But Gauss–Markov is a purely second-moment (variance) statement, established using only linearity, unbiasedness, and the covariance structure of the errors — the entire proof never touches the error distribution beyond its mean and covariance. So the BLUE property holds identically whether the errors are normal, uniform, or any other mean-zero, finite-variance, uncorrelated distribution; normality adds distributional guarantees on top of, not instead of, the variance-optimality already secured by Gauss–Markov.

Is the least squares estimator still BLUE if the errors are correlated but the true covariance is unknown?

The theorem as stated assumes Cov(ε)=σ2In\mathrm{Cov}(\varepsilon) = \sigma^2 I_n exactly, so if the true covariance is Σ≠σ2I\Sigma \ne \sigma^2 I (whether or not you know Σ\Sigma), OLS generally is not BLUE — the counterexample block exhibits an explicit linear unbiased estimator beating OLS when Σ\Sigma is diagonal but unequal. If Σ\Sigma is known, the Aitken/GLS estimator (X⊤Σ−1X)−1X⊤Σ−1Y(X^\top\Sigma^{-1}X)^{-1}X^\top\Sigma^{-1}Y is BLUE instead. If Σ\Sigma is unknown, one typically estimates it and uses feasible GLS, which is no longer exactly linear in YY (since the weights depend on the data) and so falls outside the strict linear-estimator framework of this theorem.

Does the theorem say OLS has the smallest mean squared error among all estimators?

No — it only compares OLS to other linear and unbiased estimators. Mean squared error decomposes as variance plus squared bias; a biased estimator that sacrifices some unbiasedness can achieve lower total MSE than any unbiased estimator, linear or not. Ridge regression and shrinkage estimators (e.g. James–Stein-type ideas) exploit exactly this tradeoff, deliberately introducing bias to shrink variance more than proportionally, and can beat OLS in MSE. This is fully compatible with Gauss–Markov, since those estimators leave the linear-unbiased class the theorem restricts attention to.

What role does the full column rank assumption on X play?

Full column rank of XX (equivalently, X⊤XX^\top X invertible) is what makes β^=(X⊤X)−1X⊤Y\hat\beta = (X^\top X)^{-1}X^\top Y well defined in the first place; without it there are infinitely many β\beta giving the same XβX\beta, so β\beta itself is not identifiable from the model and no unbiased estimator of β\beta (linear or not) can exist for all of β\beta's components. In that degenerate case, only certain linear combinations c⊤βc^\top\beta that lie in the row space of XX are "estimable," and a version of the theorem still holds for those estimable functionals using generalized inverses, but the clean matrix statement given here requires full rank.

How does this relate to the Cramér–Rao lower bound?

The Cramér–Rao bound is a different optimality benchmark: it lower-bounds the variance of any unbiased estimator (linear or not) using the Fisher information, and requires a fully specified likelihood (hence typically normality here) to compute. Gauss–Markov requires no likelihood and no distributional assumption beyond first two moments, but only competes against linear estimators. When the errors are in fact normal, the OLS estimator's variance actually attains the Cramér–Rao bound among all unbiased estimators, linear or not — a strictly stronger and additional fact than Gauss–Markov alone provides, and one that does require normality.

Can Gauss–Markov fail if the model itself is misspecified, e.g. the true relationship is nonlinear in x?

Yes, but that failure is of a different kind: if E[Y]≠Xβ\mathbb{E}[Y] \ne X\beta for any β\beta (model misspecification), then the entire premise Y=Xβ+ε, E[ε]=0Y=X\beta+\varepsilon,\ \mathbb{E}[\varepsilon]=0 is false, so OLS is generally biased for the "true" underlying regression function, and the theorem — which presupposes the linear model holds exactly — simply does not apply; it is not being violated, it is out of scope. This is why checking linearity (e.g. via residual plots) is a prerequisite for trusting any Gauss–Markov-based optimality claim, separate from checking the moment conditions on ε\varepsilon.

Before this