# Least-squares estimation of linear regression coefficients

﻿
Least-squares estimation of linear regression coefficients

In parametric statistics, the least-squares estimator is often used to estimate the coefficients of a linear regression. The least-squares estimator optimizes a certain criterion (namely it minimizes the sum of the square of the residuals). In this article, after setting the mathematical context of linear regression, we will motivate the use of the least-squares estimator $widehat\left\{ heta\right\}_\left\{LS\right\}$ and derive its expression (as seen for example in the article regression analysis):

:$widehat\left\{ heta\right\}_\left\{LS\right\}=\left(mathbf\left\{X\right\}^tmathbf\left\{X\right\}\right)^\left\{-1\right\}mathbf\left\{X\right\}^tvec\left\{Y\right\}$

We conclude by giving some qualities of this estimator and a geometrical interpretation.

Assumptions

For $pinmathbb\left\{N\right\}^+$, let "Y" be a random variable taking values in $mathbb\left\{R\right\}$, we call observation.

We next define the function η, linear in $heta$:

$eta\left(X; heta\right)=sum_\left\{j=1\right\}^p heta_j X_j,$

where
* For $jin \left\{1,...,p\right\}$, $X_j$ is a random variable taking values in $mathbb\left\{R\right\}$ and is called a factor and
* $heta_j$ is a scalar, for $jin \left\{1,...,p\right\}$, and $heta^t=\left( heta_1,cdots, heta_p\right)$, where $heta^t$ denotes the transpose of vector $heta$.

Let $X^t=\left(X_1,cdots,X_p\right)$. We can write $eta\left(X; heta\right)=X^t heta$. Define the error to be:

$varepsilon\left( heta\right)=Y-X^t heta$

We suppose that there exists a true parameter $overline\left\{ heta\right\}inmathbb\left\{R\right\}^\left\{p\right\}$ such that $mathbb\left\{E\right\} \left[varepsilon\left(overline\left\{ heta\right\}\right)|X\right] =0$. This means that, given the random variables $\left(X_1,cdots,X_p\right)$, the best prediction we can make of "Y" is $Y=eta\left(X;overline\left\{ heta\right\}\right)=X^toverline\left\{ heta\right\}$. Henceforth, $varepsilon$ will denote $varepsilon\left(overline\left\{ heta\right\}\right)$ and η will represent $eta\left(X;overline\left\{ heta\right\}\right)$.

Least-squares estimator

The idea behind the least-squares estimator is to see linear regression as an orthogonal projection. Let "F" be the L2-space of all random variables whose square has a finite Lebesgue integral. Let "G" be the linear subspace of $F$ generated by $X_1,cdots,X_p$ (supposing that $Yin F$ and $\left(X_1,cdots,X_p\right)in F^p$). We show in this paragraph that the function $eta$ is an orthogonal projection of "Y" on "G" and we will construct the least-squares estimator.

Seeing linear regression as an orthogonal projection

We have $mathbb\left\{E\right\}\left(Y|X\right)=eta$, but $Ymapstomathbb\left\{E\right\}\left(Y|X\right)$ is a projection, which means that $eta$ is a projection of "Y" on "G". What is more, this projection is an orthogonal one.

To see this, we can build a scalar product in "F": for all couples of random variables $X,Yin F$, we define$langle X,Y angle_2:=mathbb\left\{E\right\} \left[X Y\right]$. It is indeed a scalar product because if $|X|_2^2=0$, then $X=0$ almost everywhere (where $|X|_2^2:=langle X,X angle_2$ is the norm corresponding to this scalar product).

For all $1leq jleq p$,

:

Therefore, $varepsilon$ is orthogonal to any $X_j$ and hence to the whole of the subspace "G", which means that $eta$ is a projection of "Y" on "G", orthogonal with respect to the scalar product we have just defined. We have therefore shown:

$eta\left(X;overline\left\{ heta\right\}\right)=min_\left\{fin G\right\}|Y-f|^2_2.$

Estimating the coefficients

If, for each $jin\left\{1,cdots,p\right\}$ we have a sample of size $n>p, \left(X^1_j,cdots,X^n_j\right)$ of $X_j$, along with a vector $vec\left\{Y\right\}$ of "n" observations of "Y", we can build an estimation of the coefficients of this orthogonal projection. To do this, we can use an estimation of the scalar product defined earlier.

For all couples of samples of size "n" $vec\left\{U\right\},vec\left\{V\right\}in F^n$ of random variables "U" and "V", we define $langle vec\left\{U\right\},vec\left\{V\right\} angle:=vec\left\{U\right\}^t vec\left\{V\right\}$, where $vec\left\{U\right\}^t$ is the transpose of vector $vec\left\{U\right\}$, and $|cdot|:=sqrt\left\{langle cdot,cdot angle\right\}$. Note that the scalar product $langle cdot,cdot angle$ is defined in $F^n$ and no longer in "F".

Let us define the design matrix (or random design), a $n imes p$ random matrix:

We can now adapt the minimization of the sum of the residuals: the least-squares estimator $widehat\left\{ heta\right\}_\left\{LS\right\}$ will be the value, if it exists, of $heta$ which minimizes $|mathbf\left\{X\right\} heta-vec\left\{Y\right\}|^2$. Therefore, $langle mathbf\left\{X\right\},vec\left\{varepsilon\right\}\left(widehat\left\{ heta\right\}_\left\{LS\right\}\right) angle= mathbf\left\{X\right\}^t\left(mathbf\left\{X\right\}widehat\left\{ heta\right\}_\left\{LS\right\}-vec\left\{Y\right\}\right)=0$.

This yields $mathbf\left\{X\right\}^t mathbf\left\{X\right\} widehat\left\{ heta\right\}_\left\{LS\right\} = mathbf\left\{X\right\}^t vec\left\{Y\right\}$. If $mathbf\left\{X\right\}$ is of full rank, then so is $mathbf\left\{X\right\}^t mathbf\left\{X\right\}$. In that case we can compute the least-squares estimator explicitly by inverting the $p imes p$ matrix $mathbf\left\{X\right\}^tmathbf\left\{X\right\}$:

$widehat\left\{ heta\right\}_\left\{LS\right\}=\left(mathbf\left\{X\right\}^tmathbf\left\{X\right\}\right)^\left\{-1\right\} mathbf\left\{X\right\}^t vec\left\{Y\right\}$

Qualities and geometrical interpretation

Qualities of this estimator

Not only is the least-square estimator easy to compute, but under the Gauss-Markov assumptions, the Gauss-Markov theorem states that the least-square estimators is the best linear unbiased estimator (BLUE) of $overline\left\{ heta\right\}$.

The vector of errors $vec\left\{varepsilon\right\}=vec\left\{Y\right\}-mathbf\left\{X\right\}overline\left\{ heta\right\}$ is said to fulfil the Gauss-Markov assumptions if: :*$mathbb\left\{E\right\}vec\left\{varepsilon\right\}=vec\left\{0\right\}$:*$mathbb\left\{V\right\}vec\left\{varepsilon\right\}=sigma^2 mathbf\left\{I\right\}_n$ (uncorrelated but not necessarily independent; homoscedastic but not necessarily identically distributed)

where $sigma^2<+infty$ and $mathbf\left\{I\right\}_n$ is the $n imes n$ identity matrix.

This decisive advantage has led to a sometimes abusive use of least-squares. Least-squares depends on the fulfilment of the Gauss-Markov hypothesis and applying this method in a situation where these conditions are not met can lead to inaccurate results. For example, in the study of time-series, it is often difficult to assume independence of the residuals.

Geometrical interpretation

The situation described by the linear regression problem can be geometrically seen as follows:

The least-squares is also an M-estimator of $ho$-type for $ho\left(r\right):=frac\left\{r^2\right\}\left\{2\right\}$.

Wikimedia Foundation. 2010.

### Look at other dictionaries:

• Least squares — The method of least squares is a standard approach to the approximate solution of overdetermined systems, i.e., sets of equations in which there are more equations than unknowns. Least squares means that the overall solution minimizes the sum of… …   Wikipedia

• Linear regression — Example of simple linear regression, which has one independent variable In statistics, linear regression is an approach to modeling the relationship between a scalar variable y and one or more explanatory variables denoted X. The case of one… …   Wikipedia

• Least-squares spectral analysis — (LSSA) is a method of estimating a frequency spectrum, based on a least squares fit of sinusoids to data samples, similar to Fourier analysis. [cite book | title = Variable Stars As Essential Astrophysical Tools | author = Cafer Ibanoglu |… …   Wikipedia

• Linear least squares (mathematics) — This article is about the mathematics that underlie curve fitting using linear least squares. For statistical regression analysis using least squares, see linear regression. For linear regression on a single variable, see simple linear regression …   Wikipedia

• Ordinary least squares — This article is about the statistical properties of unweighted linear regression analysis. For more general regression analysis, see regression analysis. For linear regression on a single variable, see simple linear regression. For the… …   Wikipedia

• Regression analysis — In statistics, regression analysis is a collective name for techniques for the modeling and analysis of numerical data consisting of values of a dependent variable (response variable) and of one or more independent variables (explanatory… …   Wikipedia

• Regression Analysis of Time Series — Infobox Software name = RATS caption = developer = Estima latest release version = 7.0 latest release date = 2007 operating system = Cross platform genre = econometrics software license = Proprietary website =… …   Wikipedia

• Linear algebra — R3 is a vector (linear) space, and lines and planes passing through the origin are vector subspaces in R3. Subspaces are a common object of study in linear algebra. Linear algebra is a branch of mathematics that studies vector spaces, also called …   Wikipedia

• Linear probability model — The linear probability specification of a binary regression model assumes that, for binary outcome Y and regressor vector X ,: Pr(Y=1 | X=x) = x eta. A drawback of this model is that, unless restrictions are placed on eta , the estimated… …   Wikipedia

• Deming regression — Deming regression. The red lines show the error in both x and y. This is different from the traditional least squares method which measures error parallel to the y axis. The case shown, with deviations measured perpendicularly, arises when x and… …   Wikipedia