Theorem related to ordinary least squares
Part of a series on |
Regression analysis |
---|
Models |
---|
- Linear regression
- Simple regression
- Polynomial regression
- General linear model
|
- Generalized linear model
- Vector generalized linear model
- Discrete choice
- Binomial regression
- Binary regression
- Logistic regression
- Multinomial logistic regression
- Mixed logit
- Probit
- Multinomial probit
- Ordered logit
- Ordered probit
- Poisson
|
|
|
|
Estimation |
---|
|
|
|
|
Background |
---|
|
Mathematics portal
|
|
In statistics, the Gauss–Markov theorem (or simply Gauss theorem for some authors)[1] states that the ordinary least squares (OLS) estimator has the lowest sampling variance within the class of linear unbiased estimators, if the errors in the linear regression model are uncorrelated, have equal variances and expectation value of zero.[2] The errors do not need to be normal, nor do they need to be independent and identically distributed (only uncorrelated with mean zero and homoscedastic with finite variance). The requirement that the estimator be unbiased cannot be dropped, since biased estimators exist with lower variance. See, for example, the James–Stein estimator (which also drops linearity), ridge regression, or simply any degenerate estimator.
The theorem was named after Carl Friedrich Gauss and Andrey Markov, although Gauss' work significantly predates Markov's.[3] But while Gauss derived the result under the assumption of independence and normality, Markov reduced the assumptions to the form stated above.[4] A further generalization to non-spherical errors was given by Alexander Aitken.[5]
Scalar Case Statement
Suppose we are given two random variable vectors,
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
![{\displaystyle y=X\beta +\varepsilon ,\quad (y,\varepsilon \in \mathbb {R} ^{n},\beta \in \mathbb {R} ^{K}{\text{ and }}X\in \mathbb {R} ^{n\times K})}](https://wikimedia.org/api/rest_v1/media/math/render/svg/d070addb31f8c6180e6cce074a6ed72de46cd76c)
expanding to,
![{\displaystyle y_{i}=\sum _{j=1}^{K}\beta _{j}X_{ij}+\varepsilon _{i}\quad \forall i=1,2,\ldots ,n}](https://wikimedia.org/api/rest_v1/media/math/render/svg/82a9904c69ebb5948e4da9f83e73890513a6b18f)
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 X 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
and - Distinct error terms are uncorrelated:
![{\displaystyle {\text{Cov}}(\varepsilon _{i},\varepsilon _{j})=0,\forall i\neq j.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/51f27904d36bbacd8d7fbc880a30aca14223246b)
A linear estimator of
is a linear combination
![{\displaystyle {\widehat {\beta }}_{j}=c_{1j}y_{1}+\cdots +c_{kj}y_{k}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/85e9cd3170dd72adea25d8c1e5aef37ed00707bd)
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
![{\displaystyle \operatorname {E} \left[{\widehat {\beta }}_{j}\right]=\beta _{j}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/51967081e42dea692d45a7331ec58e7a29acf3d5)
regardless of the values of
. Now, let
be some linear combination of the coefficients. Then the mean squared error of the corresponding estimation is
![{\displaystyle \operatorname {E} \left[\left(\sum _{j=1}^{K}\lambda _{j}\left({\widehat {\beta }}_{j}-\beta _{j}\right)\right)^{2}\right],}](https://wikimedia.org/api/rest_v1/media/math/render/svg/fae4692be86723675447fb34706028914ec2cddb)
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
![{\displaystyle \operatorname {Var} \left({\widetilde {\beta }}\right)-\operatorname {Var} \left({\widehat {\beta }}\right)}](https://wikimedia.org/api/rest_v1/media/math/render/svg/36d0ac69a50b114a57c37e2079a7192fa42c324b)
is a positive semi-definite matrix for every other linear unbiased estimator
.
The ordinary least squares estimator (OLS) is the function
![{\displaystyle {\widehat {\beta }}=(X^{\operatorname {T} }X)^{-1}X^{\operatorname {T} }y}](https://wikimedia.org/api/rest_v1/media/math/render/svg/ebc0fee46f6146ed5e09c96b3930b1510cfd1940)
of
and
(where
denotes the transpose of
) that minimizes the sum of squares of residuals (misprediction amounts):
![{\displaystyle \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}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/8718317d8b53b5791069626a8f3d77a107469aa3)
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.
Proof
Let
be another linear estimator of
with
where
is a
non-zero 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
the OLS estimator. We calculate:
![{\displaystyle {\begin{aligned}\operatorname {E} \left[{\tilde {\beta }}\right]&=\operatorname {E} [Cy]\\&=\operatorname {E} \left[\left((X^{\operatorname {T} }X)^{-1}X^{\operatorname {T} }+D\right)(X\beta +\varepsilon )\right]\\&=\left((X^{\operatorname {T} }X)^{-1}X^{\operatorname {T} }+D\right)X\beta +\left((X^{\operatorname {T} }X)^{-1}X^{\operatorname {T} }+D\right)\operatorname {E} [\varepsilon ]\\&=\left((X^{\operatorname {T} }X)^{-1}X^{\operatorname {T} }+D\right)X\beta &&\operatorname {E} [\varepsilon ]=0\\&=(X^{\operatorname {T} }X)^{-1}X^{\operatorname {T} }X\beta +DX\beta \\&=(I_{K}+DX)\beta .\\\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/9efe1b70ef6d509d41df2e8981f4b0ae04784f67)
Therefore, since
is unobservable,
is unbiased if and only if
. Then:
![{\displaystyle {\begin{aligned}\operatorname {Var} \left({\tilde {\beta }}\right)&=\operatorname {Var} (Cy)\\&=C{\text{ Var}}(y)C^{\operatorname {T} }\\&=\sigma ^{2}CC^{\operatorname {T} }\\&=\sigma ^{2}\left((X^{\operatorname {T} }X)^{-1}X^{\operatorname {T} }+D\right)\left(X(X^{\operatorname {T} }X)^{-1}+D^{\operatorname {T} }\right)\\&=\sigma ^{2}\left((X^{\operatorname {T} }X)^{-1}X^{\operatorname {T} }X(X^{\operatorname {T} }X)^{-1}+(X^{\operatorname {T} }X)^{-1}X^{\operatorname {T} }D^{\operatorname {T} }+DX(X^{\operatorname {T} }X)^{-1}+DD^{\operatorname {T} }\right)\\&=\sigma ^{2}(X^{\operatorname {T} }X)^{-1}+\sigma ^{2}(X^{\operatorname {T} }X)^{-1}(DX)^{\operatorname {T} }+\sigma ^{2}DX(X^{\operatorname {T} }X)^{-1}+\sigma ^{2}DD^{\operatorname {T} }\\&=\sigma ^{2}(X^{\operatorname {T} }X)^{-1}+\sigma ^{2}DD^{\operatorname {T} }&&DX=0\\&=\operatorname {Var} \left({\widehat {\beta }}\right)+\sigma ^{2}DD^{\operatorname {T} }&&\sigma ^{2}(X^{\operatorname {T} }X)^{-1}=\operatorname {Var} \left({\widehat {\beta }}\right)\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/eecc203b4a13d3325338bda42dcbef2572f255c6)
Since
is a positive semidefinite matrix,
exceeds
by a positive semidefinite matrix.
As it has been stated before, the condition of
is a positive semidefinite matrix is equivalent to the property that the best linear unbiased estimator of
is
(best in the sense that it has minimum variance). To see this, let
another linear unbiased estimator of
.
![{\displaystyle {\begin{aligned}\operatorname {Var} \left(\ell ^{\operatorname {T} }{\tilde {\beta }}\right)&=\ell ^{\operatorname {T} }\operatorname {Var} \left({\tilde {\beta }}\right)\ell \\&=\sigma ^{2}\ell ^{\operatorname {T} }(X^{\operatorname {T} }X)^{-1}\ell +\ell ^{\operatorname {T} }DD^{\operatorname {T} }\ell \\&=\operatorname {Var} \left(\ell ^{\operatorname {T} }{\widehat {\beta }}\right)+(D^{\operatorname {T} }\ell )^{\operatorname {T} }(D^{\operatorname {T} }\ell )&&\sigma ^{2}\ell ^{\operatorname {T} }(X^{\operatorname {T} }X)^{-1}\ell =\operatorname {Var} \left(\ell ^{\operatorname {T} }{\widehat {\beta }}\right)\\&=\operatorname {Var} \left(\ell ^{\operatorname {T} }{\widehat {\beta }}\right)+\|D^{\operatorname {T} }\ell \|\\&\geq \operatorname {Var} \left(\ell ^{\operatorname {T} }{\widehat {\beta }}\right)\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/8faa4674a2251d99979b76717f5e30dc440d8726)
Moreover, equality holds if and only if
. We calculate
![{\displaystyle {\begin{aligned}\ell ^{\operatorname {T} }{\tilde {\beta }}&=\ell ^{\operatorname {T} }\left(((X^{\operatorname {T} }X)^{-1}X^{\operatorname {T} }+D)Y\right)&&{\text{ from above}}\\&=\ell ^{\operatorname {T} }(X^{\operatorname {T} }X)^{-1}X^{\operatorname {T} }Y+\ell ^{\operatorname {T} }DY\\&=\ell ^{\operatorname {T} }{\widehat {\beta }}+(D^{\operatorname {T} }\ell )^{\operatorname {T} }Y\\&=\ell ^{\operatorname {T} }{\widehat {\beta }}&&D^{\operatorname {T} }\ell =0\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/ac040a99756accbeaeb1cd461793df10a73e4108)
This proves that the equality holds if and only if
which gives the uniqueness of the OLS estimator as a BLUE.
Generalized least squares estimator
The generalized least squares (GLS), developed by Aitken,[5] extends the Gauss–Markov theorem to the case where the error vector has a non-scalar covariance matrix.[6] The Aitken estimator is also a BLUE.
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
.
Linearity
The dependent variable is assumed to be a linear function of the variables specified in the model. The specification must be linear in its parameters. This does not mean that there must be a linear relationship between the independent and dependent variables. The independent variables can take non-linear forms as long as the parameters are linear. The equation
qualifies as linear while
can be transformed to be linear by replacing
by another parameter, say
. An equation with a parameter dependent on an independent variable does not qualify as linear, for example
, where
is a function of
.
Data transformations are often used to convert an equation into a linear form. For example, the Cobb–Douglas function—often used in economics—is nonlinear:
![{\displaystyle Y=AL^{\alpha }K^{1-\alpha }e^{\varepsilon }}](https://wikimedia.org/api/rest_v1/media/math/render/svg/c15a5174e17be32d605d80725b126cd04dcab304)
But it can be expressed in linear form by taking the natural logarithm of both sides:[8]
![{\displaystyle \ln Y=\ln A+\alpha \ln L+(1-\alpha )\ln K+\varepsilon =\beta _{0}+\beta _{1}\ln L+\beta _{2}\ln K+\varepsilon }](https://wikimedia.org/api/rest_v1/media/math/render/svg/0bcbc191db71ff91df389a95594a914642ab5475)
This assumption also covers specification issues: assuming that the proper functional form has been selected and there are no omitted variables.
One should be aware, however, that the parameters that minimize the residuals of the transformed equation do not necessarily minimize the residuals of the original equation.
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.
![{\displaystyle \operatorname {rank} (\mathbf {X} )=k}](https://wikimedia.org/api/rest_v1/media/math/render/svg/62dfb55580ab18439c2ff4db4e5e1a5264f05f02)
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]
See also
Other unbiased statistics
References
- ^ See chapter 7 of Johnson, R.A.; Wichern, D.W. (2002). Applied multivariate statistical analysis. Vol. 5. Prentice hall.
- ^ Theil, Henri (1971). "Best Linear Unbiased Estimation and Prediction". Principles of Econometrics. New York: John Wiley & Sons. pp. 119–124. ISBN 0-471-85845-5.
- ^ Plackett, R. L. (1949). "A Historical Note on the Method of Least Squares". Biometrika. 36 (3/4): 458–460. doi:10.2307/2332682.
- ^ David, F. N.; Neyman, J. (1938). "Extension of the Markoff theorem on least squares". Statistical Research Memoirs. 2: 105–116. OCLC 4025782.
- ^ a b Aitken, A. C. (1935). "On Least Squares and Linear Combinations of Observations". Proceedings of the Royal Society of Edinburgh. 55: 42–48. doi:10.1017/S0370164600014346.
- ^ a b Huang, David S. (1970). Regression and Econometric Methods. New York: John Wiley & Sons. pp. 127–147. ISBN 0-471-41754-8.
- ^ Hayashi, Fumio (2000). Econometrics. Princeton University Press. p. 13. ISBN 0-691-01018-8.
- ^ Walters, A. A. (1970). An Introduction to Econometrics. New York: W. W. Norton. p. 275. ISBN 0-393-09931-8.
- ^ Hayashi, Fumio (2000). Econometrics. Princeton University Press. p. 7. ISBN 0-691-01018-8.
- ^ Johnston, John (1972). Econometric Methods (Second ed.). New York: McGraw-Hill. pp. 267–291. ISBN 0-07-032679-7.
- ^ Wooldridge, Jeffrey (2012). Introductory Econometrics (Fifth international ed.). South-Western. p. 220. ISBN 978-1-111-53439-4.
- ^ Johnston, John (1972). Econometric Methods (Second ed.). New York: McGraw-Hill. pp. 159–168. ISBN 0-07-032679-7.
- ^ Hayashi, Fumio (2000). Econometrics. Princeton University Press. p. 10. ISBN 0-691-01018-8.
- ^ Ramanathan, Ramu (1993). "Nonspherical Disturbances". Statistical Methods in Econometrics. Academic Press. pp. 330–351. ISBN 0-12-576830-3.
Further reading
- Davidson, James (2000). "Statistical Analysis of the Regression Model". Econometric Theory. Oxford: Blackwell. pp. 17–36. ISBN 0-631-17837-6.
- Goldberger, Arthur (1991). "Classical Regression". A Course in Econometrics. Cambridge: Harvard University Press. pp. 160–169. ISBN 0-674-17544-1.
- Theil, Henri (1971). "Least Squares and the Standard Linear Model". Principles of Econometrics. New York: John Wiley & Sons. pp. 101–162. ISBN 0-471-85845-5.
External links
- Earliest Known Uses of Some of the Words of Mathematics: G (brief history and explanation of the name)
- Proof of the Gauss Markov theorem for multiple linear regression (makes use of matrix algebra)
- A Proof of the Gauss Markov theorem using geometry