Scalar case statement
Suppose we are given two random variables
and that we want to find the best linear estimator of
given
, using the best linear estimator
where the parameters
and
are both real numbers.
Such an estimator
would have the same mean and standard deviation as
, that is,
.
Therefore, if the vector
has respective mean and standard deviation
, the best linear estimator would be
since
has the same mean and standard deviation as
.
Statement
Suppose we have, in matrix notation, the linear relationship
where
are non-random but unobservable parameters,
are non-random and observable (called the "explanatory variables"),
are random, and so
are random. The random variables
are called the "disturbance", "noise" or simply "error" (will be contrasted with "residual" 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
with a newly introduced last column of
being unity i.e.,
for all
. Note that though
, as sample responses, are observable, the following statements and arguments including assumptions, proofs and the others assume under the only condition of knowing
but not 
The Gauss–Markov assumptions concern the set of error random variables
:
- They have mean zero:
![{\displaystyle \operatorname {E} [\varepsilon _{i}]=0.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/7fe1f9c424cd89a5b80330aefabefad56ff992cb)
- They are homoscedastic, that is, all have the same finite variance:
for all
.
- Distinct error terms are uncorrelated:

A linear estimator of
is a linear combination
in which the coefficients
are not allowed to depend on the underlying coefficients
, since those are not observable, but are allowed to depend on the values
, since these data are observable. (The dependence of the coefficients on each
is typically nonlinear; the estimator is linear in each
and hence in each random
which is why this is "linear" regression.) The estimator is said to be unbiased if and only if
regardless of the values of
. Now, let
be some linear combination of the coefficients. Then the mean squared error of the corresponding estimation is
in other words, 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
of parameters
is one with the smallest mean squared error for every vector
of linear combination parameters. This is equivalent to the condition that
is a positive semi-definite matrix for every other linear unbiased estimator
.
The ordinary least squares estimator (OLS) is the function
of
and
(where
denotes the transpose of
) that minimizes the sum of squares of residuals (misprediction amounts):

The theorem now states that the OLS estimator is a best linear unbiased estimator (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
whose coefficients do not depend upon the unobservable
but whose expected value is always zero.
Proof that the OLS indeed minimizes the sum of squares of residuals may proceed as follows with a calculation of the Hessian matrix and showing that it is positive definite.
The MSE function we want to minimize is
for a multiple regression model with p variables. The first derivative is
where
is the design matrix

The Hessian matrix of second derivatives is

Assuming the columns of
are linearly independent so that
is invertible, let
, then

Now let
be an eigenvector of
.

In terms of vector multiplication, this means
where
is the eigenvalue corresponding to
. Moreover,

Finally, as eigenvector
was arbitrary, it means all eigenvalues of
are positive, therefore
is positive definite. Thus,
is indeed a global minimum.
Or, just see that for all vectors
. So the Hessian is positive definite if full rank.
Gauss–Markov theorem as stated in econometrics
In most treatments of OLS, the regressors (parameters of interest) in the design matrix
are assumed to be fixed in repeated samples. This assumption is considered inappropriate for a predominantly nonexperimental science like econometrics.[7] Instead, the assumptions of the Gauss–Markov theorem are stated conditional on
.
Strict exogeneity
For all
observations, the expectation—conditional on the regressors—of the error term is zero:[9]
![{\displaystyle \operatorname {E} [\,\varepsilon _{i}\mid \mathbf {X} ]=\operatorname {E} [\,\varepsilon _{i}\mid \mathbf {x} _{1},\dots ,\mathbf {x} _{n}]=0.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/48c0f4469c642f2c845dba18fbc727baf672606f)
where
is the data vector of regressors for the ith observation, and consequently
is the data matrix or design matrix.
Geometrically, this assumption implies that
and
are orthogonal to each other, so that their inner product (i.e., their cross moment) is zero.
![{\displaystyle \operatorname {E} [\,\mathbf {x} _{j}\cdot \varepsilon _{i}\,]={\begin{bmatrix}\operatorname {E} [\,{x}_{j1}\cdot \varepsilon _{i}\,]\\\operatorname {E} [\,{x}_{j2}\cdot \varepsilon _{i}\,]\\\vdots \\\operatorname {E} [\,{x}_{jk}\cdot \varepsilon _{i}\,]\end{bmatrix}}=\mathbf {0} \quad {\text{for all }}i,j\in n}](https://wikimedia.org/api/rest_v1/media/math/render/svg/09401fc11433c3ecccdda992a223aa3769103861)
This assumption is violated if the explanatory variables are measured with error, or are endogenous.[10] Endogeneity can be the result of simultaneity, where causality flows back and forth between both the dependent and independent variable. Instrumental variable techniques are commonly used to address this problem.
Full rank
The sample data matrix
must have full column rank.

Otherwise
is not invertible and the OLS estimator cannot be computed.
A violation of this assumption is perfect multicollinearity, i.e. some explanatory variables are linearly dependent. One scenario in which this will occur is called "dummy variable trap," when a base dummy variable is not omitted resulting in perfect correlation between the dummy variables and the constant term.[11]
Multicollinearity (as long as it is not "perfect") can be present resulting in a less efficient, but still unbiased estimate. The estimates will be less precise and highly sensitive to particular sets of data.[12] Multicollinearity can be detected from condition number or the variance inflation factor, among other tests.
Spherical errors
The outer product of the error vector must be spherical.
![{\displaystyle \operatorname {E} [\,{\boldsymbol {\varepsilon }}{\boldsymbol {\varepsilon }}^{\operatorname {T} }\mid \mathbf {X} ]=\operatorname {Var} [\,{\boldsymbol {\varepsilon }}\mid \mathbf {X} ]={\begin{bmatrix}\sigma ^{2}&0&\cdots &0\\0&\sigma ^{2}&\cdots &0\\\vdots &\vdots &\ddots &\vdots \\0&0&\cdots &\sigma ^{2}\end{bmatrix}}=\sigma ^{2}\mathbf {I} \quad {\text{with }}\sigma ^{2}>0}](https://wikimedia.org/api/rest_v1/media/math/render/svg/9e77dc4b4de4a67e20a72e8dc32b8cd30e511c17)
This implies the error term has uniform variance (homoscedasticity) and no serial correlation.[13] If this assumption is violated, OLS is still unbiased, but inefficient. The term "spherical errors" will describe the multivariate normal distribution: if
in the multivariate normal density, then the equation
is the formula for a ball centered at μ with radius σ in n-dimensional space.[14]
Heteroskedasticity occurs when the amount of error is correlated with an independent variable. For example, in a regression on food expenditure and income, the error is correlated with income. Low income people generally spend a similar amount on food, while high income people may spend a very large amount or as little as low income people spend. Heteroskedastic can also be caused by changes in measurement practices. For example, as statistical offices improve their data, measurement error decreases, so the error term declines over time.
This assumption is violated when there is autocorrelation. Autocorrelation can be visualized on a data plot when a given observation is more likely to lie above a fitted line if adjacent observations also lie above the fitted regression line. Autocorrelation is common in time series data where a data series may experience "inertia." If a dependent variable takes a while to fully absorb a shock. Spatial autocorrelation can also occur geographic areas are likely to have similar errors. Autocorrelation may be the result of misspecification such as choosing the wrong functional form. In these cases, correcting the specification is one possible way to deal with autocorrelation.
When the spherical errors assumption may be violated, the generalized least squares estimator can be shown to be BLUE.[6]