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.
- The linear model is with and .
- Under these assumptions, the OLS estimator is unbiased for .
- Among all estimators linear in and unbiased for , OLS minimizes variance in every direction: for any linear unbiased and any vector .
- No distributional assumption (e.g. normality) is needed; normality is only needed for exact finite-sample confidence intervals and /-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?
Let and consider observed data generated by
where:
- is a fixed (non-random, "design") matrix of full column rank , known to the statistician;
- is an unknown fixed parameter vector;
- is an unobserved random error vector satisfying
for some unknown (i.e. errors have mean zero, common variance , and are pairwise uncorrelated). No assumption of normality, or of independence beyond uncorrelatedness, is imposed. An estimator of is called:
- linear if for some fixed (non-random) matrix , possibly depending on but not on or ;
- unbiased if for every .
The ordinary least squares estimator is
which is well-defined since has full column rank (so is invertible).
Intuition
Think of as one particular linear rule for reading off coefficients from data, built from the matrix . There are infinitely many other linear rules ; the unbiasedness constraint for all forces , which is a strong linear constraint on but still leaves an entire affine family of valid matrices (any of the form where ). Each such defines a legitimate unbiased linear estimator, and the theorem says that padding with any nonzero " satisfying " can only inflate variance, never shrink it. Geometrically, means the rows of live in the orthogonal complement (with respect to the ordinary inner product on ) of the column space of — the same subspace that contains the OLS residuals. Adding such a to injects "extra noise" that is uncorrelated with the useful signal captured by , and uncorrelated terms add variance rather than cancel it. This is exactly the Pythagorean-like decomposition the proof makes precise.
The central theorem
Consider the linear model of the Definition above: , fixed of full column rank , , , unknown. Let
be the OLS estimator. Let be any linear unbiased estimator of (i.e. fixed with ). Then for every fixed vector ,
with equality for all if and only if almost surely in the sense that with probability 1 (equivalently, satisfies , which under with forces ). Equivalently, in the Loewner (positive semidefinite) order on covariance matrices,
That is, is the Best Linear Unbiased Estimator (BLUE) of .
A linear estimator (with a fixed matrix not depending on ) is unbiased for for every if and only if .
Technique: direct computation of expectation, then a linear-algebra identification argument. Using and linearity of expectation,
since by hypothesis. Unbiasedness for every means
i.e. for all , which holds if and only if the matrix is the zero matrix (apply it to each standard basis vector to recover column ). Hence unbiasedness for all is equivalent to .
∎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 be any linear unbiased estimator of . By the Lemma, unbiasedness is equivalent to . Define
so that . We first show :
using (unbiasedness of ) and the trivial identity (unbiasedness of OLS itself, which is the special case ).
Step 2: Compute the covariance matrix of . Since is an affine function of the random vector with fixed , we have (using ). Covariance is invariant under adding a constant vector, so
using the standard identity for a fixed matrix , and the hypothesis . Substitute and write for brevity, so :
Now compute . We have from Step 1, hence transposing, , so
Symmetrically . Therefore the cross terms vanish and
Consequently
where we used that by the same covariance identity applied to (this is the case, so it is consistent, not an extra assumption).
Step 3: The extra term is positive semidefinite. For any fixed vector , the scalar , since it is the squared Euclidean norm of the vector . Hence is a positive semidefinite matrix, i.e. , and since , also .
Step 4: Conclude variance comparison. For any fixed ,
which is the claimed inequality. This also proves the matrix statement , i.e. the Loewner order claim.
Step 5: Equality case. Equality for a particular holds iff , i.e. (since ) iff . Equality for every forces for all , hence , hence , hence , i.e. with probability 1 (they are the same linear function of ). Conversely if equality trivially holds for every . This establishes the equality characterization.
∎For any fixed vector , among all linear unbiased estimators of the scalar (meaning fixed with for all ), the estimator has the smallest variance.
Technique: reduction to the theorem via the row-space characterization of unbiased linear functionals. If is unbiased for for all , then for all , forcing (same basis-vector argument as the Lemma). One can always extend to a full unbiased matrix with as one row: concretely, take for suitable with and for the target row — more directly, apply Step 1–4 of the theorem's proof to the single linear combination estimated by , noting the proof of the theorem never used more than one row of at a time (the argument was carried out for a fixed vector throughout). Hence by exactly the computation of Steps 2–4 with replaced by the row vector and replaced by the standard functional evaluated at that row.
∎Worked examples
Example 1 — Simple linear regression with an asymmetric design, comparing OLS to the sample-mean-of-slopes competitor. Consider observations of a simple regression with design points
deliberately unequally spaced (asymmetric) so that no cancellation simplifies the algebra. Assume with . The design matrix is
Compute
So
The OLS estimator of (the slope) has row vector
Compute entrywise: and . Sum:
Check unbiasedness-consistency: ✓ (intercept-orthogonality), and ✓, confirming as required for unbiasedly estimating . Its variance (using , so ):
Simplify: (dividing numerator and denominator by 32). So
Indeed , so .
A genuinely different linear unbiased competitor. Consider the two-point-slope estimator using only the two extreme observations:
This is linear in with weight vector . Check unbiasedness: ✓, so for all : it is a legitimate linear unbiased competitor. Its variance: . Compare: , 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 numerically. Reuse the design above but now estimate the full vector . 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 satisfying directly and confirm the variance inflation formula, which is the mechanism underlying the whole theorem. Since means each row of is orthogonal (dot product zero) to both columns of — i.e. orthogonal to and to — we need vectors in orthogonal to both. The orthogonal complement of in is 2-dimensional. Find one such vector by solving , . Try with
Pick , : then , and . So . Check: sum ✓; weighted sum ✓. Let be the matrix with first row scaled by a constant 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):
Then still satisfies (since ), so is a valid linear unbiased estimator of for any . The OLS row for the intercept is (first row of ):
Check: ✓; ✓, confirming this row correctly estimates unbiasedly. . Simplify: . , , so ratio . Since and , this doesn't reduce further nicely; numerically . So (using ). Now the perturbed row is (rows add since 's first row is ). Its squared norm:
We already know from the general proof that the cross term must vanish (since forces -type cross terms to vanish row-wise too — let's verify directly): ✓ Confirms the cross-term cancellation proved abstractly in Step 2 of the theorem's proof. . So
for every , with equality iff , i.e. iff — exactly reproducing the theorem's conclusion and equality condition in a fully explicit numerical instance. For example at : .
Drop only the assumption , replacing it with a known heteroscedastic covariance where is diagonal but not a multiple of the identity — everything else in the model (linearity, , fixed full-rank ) is retained. We exhibit a linear unbiased estimator that strictly beats OLS in variance, so OLS is no longer BLUE. Take , , model with (so ), and
i.e. , , uncorrelated but not equal variance. OLS estimator: , weight vector , unbiased since . Its variance:
Now consider the (generalized-least-squares-motivated) weighted estimator with weights inversely proportional to variance: (so , ensuring unbiasedness since ). This is linear () and unbiased ( ✓). Its variance:
Since , the weighted estimator 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 (in particular, equal variances — homoscedasticity) is essential, not a mere convenience. (In fact this weighted estimator is exactly the Generalized Least Squares estimator , which replaces OLS as BLUE once ; this is the content of the Aitken generalization, mentioned here only to locate the counterexample, not proved.)
Scope, edge cases & common traps
| Situation | What Gauss–Markov does / does not say |
|---|---|
| Errors correlated or heteroscedastic () | OLS is not guaranteed BLUE; see counterexample above; GLS is BLUE instead |
| Errors non-normal but i.i.d. with finite variance | OLS is still BLUE; theorem needs no normality anywhere |
| not full column rank | does not exist; OLS estimator of itself is not even defined (only certain linear combinations may be estimable) |
| Nonlinear (biased) competitors, e.g. ridge/James–Stein-type shrinkage | Theorem says nothing — such estimators are not linear-unbiased and can have smaller variance or MSE by trading away unbiasedness |
| Small sample, want exact confidence intervals | Requires normality of in addition to Gauss–Markov assumptions; BLUE-ness alone gives no distributional guarantee |
| Random design | Theorem as stated conditions on fixed; extends by conditioning arguments if with the same conditional moment structure |
The mathematician behind it
Origins · 1 minCarl Friedrich Gauss and how this was discovered
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.
Does Gauss–Markov require the errors to be independent, or just uncorrelated?
Only uncorrelated. The hypothesis is , 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 . 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 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 - and -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 exactly, so if the true covariance is (whether or not you know ), OLS generally is not BLUE — the counterexample block exhibits an explicit linear unbiased estimator beating OLS when is diagonal but unequal. If is known, the Aitken/GLS estimator is BLUE instead. If is unknown, one typically estimates it and uses feasible GLS, which is no longer exactly linear in (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 (equivalently, invertible) is what makes well defined in the first place; without it there are infinitely many giving the same , so itself is not identifiable from the model and no unbiased estimator of (linear or not) can exist for all of 's components. In that degenerate case, only certain linear combinations that lie in the row space of 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 for any (model misspecification), then the entire premise 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 .