# Gauss–Markov theorem

Not to be confused with Gauss–Markov process.
"BLUE" redirects here. For queue management algorithm, see Blue (queue management algorithm).

In statistics, the Gauss–Markov theorem, named after Carl Friedrich Gauss and Andrey Markov, states that in a linear regression model in which the errors have expectation zero and are uncorrelated and have equal variances, the best linear unbiased estimator (BLUE) of the coefficients is given by the ordinary least squares (OLS) estimator. Here "best" means giving the lowest variance of the estimate, as compared to other unbiased, linear estimates. The errors don't need to be normal, nor do they need to be independent and identically distributed (only uncorrelated and homoscedastic). The hypothesis that the estimator be unbiased cannot be dropped, since otherwise estimators better than OLS exist. See for examples the James–Stein estimator (which also drops linearity) or ridge regression.

## Statement

Suppose we have in matrix notation,

$\underline{y} = X \underline{\beta} + \underline{\varepsilon},\quad (\underline{y},\underline{\varepsilon} \in \mathbb{R}^n, \beta \in \mathbb{R}^K \text{ and } X\in\mathbb{R}^{n\times K})$

expanding to,

$y_i=\sum_{j=1}^{K}\beta_j X_{ij}+\varepsilon_i \quad \forall i=1,2,\ldots,n$

where $\beta_j$ are non-random but unobservable parameters, $X_{ij}$ are non-random and observable (called the "explanatory variables"), $\varepsilon_i$ are random, and so $y_i$ are random. The random variables $\varepsilon_i$ are called the "residuals" or "noise" (will be contrasted with "errors" later in the article; see errors and residuals in statistics). Note that to include a constant in the model above, one can choose to introduce the constant as a variable $\beta_{K+1}$ with a newly introduced last column of X being unity i.e., $X_{i(K+1)} = 1$ for all $i$.

The Gauss–Markov assumptions are

• $E(\varepsilon_i)=0,$
• $V(\varepsilon_i)= \sigma^2 < \infty,$

(i.e., all residuals have the same variance; that is "homoscedasticity"), and

• ${\rm cov}(\varepsilon_i,\varepsilon_j) = 0, \forall i \neq j$

for $i\neq j$ that is, the noise terms are uncorrelated. A linear estimator of $\beta_j$ is a linear combination

$\widehat\beta_j = c_{1j}y_1+\cdots+c_{nj}y_n$

in which the coefficients $c_{ij}$ are not allowed to depend on the underlying coefficients $\beta_j$, since those are not observable, but are allowed to depend on the values $X_{ij}$, since these data are observable. (The dependence of the coefficients on each $X_{ij}$ is typically nonlinear; the estimator is linear in each $y_i$ and hence in each random $\varepsilon$, which is why this is "linear" regression.) The estimator is said to be unbiased if and only if

$E(\widehat\beta_j)=\beta_j\,$

regardless of the values of $X_{ij}$. Now, let $\sum_{j=1}^K\lambda_j\beta_j$ be some linear combination of the coefficients. Then the mean squared error of the corresponding estimation is

$E \left(\left(\sum_{j=1}^K\lambda_j(\widehat\beta_j-\beta_j)\right)^2\right);$

i.e., it is the expectation of the square of the weighted sum (across parameters) of the differences between the estimators and the corresponding parameters to be estimated. (Since we are considering the case in which all the parameter estimates are unbiased, this mean squared error is the same as the variance of the linear combination.) The best linear unbiased estimator (BLUE) of the vector $\beta$ of parameters $\beta_j$ is one with the smallest mean squared error for every vector $\lambda$ of linear combination parameters. This is equivalent to the condition that

$V(\tilde\beta)- V(\widehat\beta)$

is a positive semi-definite matrix for every other linear unbiased estimator $\tilde\beta$.

The ordinary least squares estimator (OLS) is the function

$\widehat\beta=(X'X)^{-1}X'y$

of $y$ and $X$ (where $X'$ denotes the transpose of $X$) that minimizes the sum of squares of residuals (misprediction amounts):

$\sum_{i=1}^n\left(y_i-\widehat{y}_i\right)^2=\sum_{i=1}^n\left(y_i-\sum_{j=1}^K\widehat\beta_j X_{ij}\right)^2.$

The theorem now states that the OLS estimator is a BLUE. The main idea of the proof is that the least-squares estimator is uncorrelated with every linear unbiased estimator of zero, i.e., with every linear combination $a_1y_1+\cdots+a_ny_n$ whose coefficients do not depend upon the unobservable $\beta$ but whose expected value is always zero.

## Proof

Let $\tilde\beta = Cy$ be another linear estimator of $\beta$ and let C be given by $(X'X)^{-1}X' + D$, where D is a $k \times n$ nonzero matrix. As we're restricting to unbiased estimators, minimum mean squared error implies minimum variance. The goal is therefore to show that such an estimator has a variance no smaller than that of $\hat\beta$, the OLS estimator.

The expectation of $\tilde\beta$ is:

\begin{align} E(Cy) &= E(((X'X)^{-1}X' + D)(X\beta + \varepsilon)) \\ &= ((X'X)^{-1}X' + D)X\beta + ((X'X)^{-1}X' + D)\underbrace{E(\varepsilon)}_0 \\ &= (X'X)^{-1}X'X\beta + DX\beta \\ &= (I_k + DX)\beta. \\ \end{align}

Therefore, $\tilde\beta$ is unbiased if and only if $DX = 0$.

The variance of $\tilde\beta$ is

\begin{align} V(\tilde\beta) &= V(Cy) = CV(y)C' = \sigma^2 CC' \\ &= \sigma^2((X'X)^{-1}X' + D)(X(X'X)^{-1} + D') \\ &= \sigma^2((X'X)^{-1}X'X(X'X)^{-1} + (X'X)^{-1}X'D' + DX(X'X)^{-1} + DD') \\ &= \sigma^2(X'X)^{-1} + \sigma^2(X'X)^{-1} (\underbrace{DX}_{0})' + \sigma^2 \underbrace{DX}_{0} (X'X)^{-1} + \sigma^2DD' \\ &= \underbrace{\sigma^2(X'X)^{-1}}_{V(\hat\beta)} + \sigma^2DD'. \end{align}

Since DD' is a positive semidefinite matrix, $V(\tilde\beta)$ exceeds $V(\hat\beta)$ by a positive semidefinite matrix.

## Generalized least squares estimator

The generalized least squares (GLS) or Aitken estimator extends the Gauss–Markov theorem to the case where the error vector has a non-scalar covariance matrix – the Aitken estimator is also a BLUE.[1]