Given an m×n matrix A with linearly independent columns, let A=QR be a QR factorization of A. Then, for each b∈Rm, the equation Ax=b has a unique least-squares solution given by:
x^=R−1QTb.
Theorem
The set of least-squares solutions of Ax=b coincides with the nonempty set of solutions of the normal equations ATAx=ATb.
Theorem
The matrix ATA is invertible if and only if the columns of A are linearly independent. In this case, the equation Ax=b has only one least-squares solution x^, and it is given by:
x^=(ATA)−1ATb.
Theorem
A vector x^ is a least-squares solution of Ax=b if and only if Ax^=projCol(A)(b).
Theorem
Let A be an m×n matrix with orthogonal columns a1,…,an, and let b∈Rm. The least-squares solution of Ax=b is x^, where the i-th entry in x^ is given by: