Linear least squares (LLS) is the least squares approximation of linear functions to data. It is a set of formulations for solving statistical problems involved in linear regression, including variants for ordinary (unweighted), weighted, and generalized (correlated) residuals. Numerical methods for linear least squares include inverting the matrix of the normal equations and orthogonal decomposition methods.
Basic formulation Consider the linear equation
where A ∈ R m × n {\displaystyle A\in \mathbb {R} ^{m\times n}} and b ∈ R m {\displaystyle b\in \mathbb {R} ^{m}} are given and x ∈ R n {\displaystyle x\in \mathbb {R} ^{n}} is a variable to be computed. When m > n , {\displaystyle m>n,} it is generally the case that (1) has no solution. For example, there is no value of x {\displaystyle x} that satisfies
[ 1 0 0 1 1 1 ] x = [ 1 1 0 ] , {\displaystyle {\begin{bmatrix}1&0\\0&1\\1&1\end{bmatrix}}x={\begin{bmatrix}1\\1\\0\end{bmatrix}},}
because the first two rows require that x = ( 1 , 1 ) , {\displaystyle x=(1,1),} but then the third row is not satisfied. Thus, for m > n , {\displaystyle m>n,} the goal of solving (1) exactly is typically replaced by finding the value of x {\displaystyle x} that minimizes some error. There are many ways that the error can be defined, but one of the most common is to define it as ‖ A x − b ‖ 2 . {\displaystyle \|Ax-b\|^{2}.}
This produces a minimization problem, called a least squares problem
The solution to the least squares problem (1) is computed by solving the normal equation
where A ⊤ {\displaystyle A^{\top }} denotes the transpose of A {\displaystyle A} . Continuing the example, above, with
A = [ 1 0 0 1 1 1 ] and b = [ 1 1 0 ] , {\displaystyle A={\begin{bmatrix}1&0\\0&1\\1&1\end{bmatrix}}\quad {\text{and}}\quad b={\begin{bmatrix}1\\1\\0\end{bmatrix}},}
we find
A ⊤ A = [ 1 0 1 0 1 1 ] [ 1 0 0 1 1 1 ] = [ 2 1 1 2 ] {\displaystyle A^{\top }A={\begin{bmatrix}1&0&1\\0&1&1\end{bmatrix}}{\begin{bmatrix}1&0\\0&1\\1&1\end{bmatrix}}={\begin{bmatrix}2&1\\1&2\end{bmatrix}}}
and
… excerpt ends here. Continue reading the full article.



