42. Least Square Solution
Dated: 20-06-2025
Least Squares Solution
The least squares solution
is the value of \(\vec x\) which makes \(A \vec x\) the closest point to \(\vec b\) in \(\text{Col } A\).
Solution of the General Least Squares Problem
Apply best approximation theorem
1 on the subspace
2 \(\text{Col }A\)
Since \(\vec b^\prime \in \text{Col } A\), the equation \(A \vec x = \vec b^\prime\) is consistent
3 and there is a solution \(\vec x^\prime \in \mathbb R^n\) such that
Since \(\vec b^\prime\) is closest point in \(\text{Col }A\) to \(\vec b\), therefore, \(\vec x^\prime\) is least squares solution of \(A \vec x = \vec b\) if and only if \(\vec x^\prime\) satisfies \(A \vec x^\prime = \vec b\).
Such \(\vec x^\prime \in \mathbb R^n\) is a list of weights that will build \(\vec b\) out of the columns
of \(A\).
Normal Equations for \(\vec x^\prime\)
Suppose that \(\vec x^\prime\) satisfies \(A \vec x^\prime = \vec b^\prime\). Then by orthogonal decomposition theorem
,4 \(\vec b\) has the property that \((\vec b - \vec b^\prime) \perp \text{Col }A\).
This means that \(\vec b - A \vec x^\prime\) is perpendicular to each column
of \(A\).
Let \(a_j\) be a column
of \(A\).
Since \(a^T_j\) is a row
of \(A^T\)
This equation represents a system of linear equations
5 called normal equations
for \(\vec x^\prime\).
Decomposition of \(\vec b\) into the sum of a vector
6 from \(\text{Col } A\) and a vector
6 perpendicular to \(\text{Col }A\)
Definition
If \(A\) is an \(m \times n\) matrix
7 and \(\vec b \in \mathbb R^n\), a least square solution of \(A \vec x = \vec b\) is an \(I \vec x^\prime \in \mathbb R^n\) such that
Theorem
The matrix
7 \(A^TA\) is invertible
8 if and only if columns
of \(A\) are linearly independent
.9 In this case
Theorem
Given an \(m \times n\) matrix
7 \(A\) with linearly independent columns
,9 let \(A = QR\) and for each \(\vec b \in \mathbb R^m\), the equation \(A \vec x = \vec b\) has a unique least squares solution given by
References
Read more about notations and symbols.
-
Read more about best approximation theorem. ↩
-
Read more about vector spaces. ↩
-
Read more about consistency of a linear system. ↩
-
Read more about orthogonal decomposition. ↩
-
Read more about linear systems. ↩
-
Read more about invertible matrices. ↩
-
Read more about linear dependency. ↩↩