Learn Linear Algebra

Theorem

Given an m×n m \times n matrix A A with linearly independent columns, let A=QR A = QR be a QR QR factorization of A A . Then, for each bRm \vec{b} \in \mathbb{R}^m , the equation Ax=b A \vec{x} = \vec{b} has a unique least-squares solution given by:

x^=R1QTb. \hat{\vec{x}} = R^{-1} Q^T \vec{b}.

Theorem

The set of least-squares solutions of Ax=b A\vec{x} = \vec{b} coincides with the nonempty set of solutions of the normal equations ATAx=ATb A^T A \vec{x} = A^T \vec{b} .

Theorem

The matrix ATA A^T A is invertible if and only if the columns of A A are linearly independent. In this case, the equation Ax=b A\vec{x} = \vec{b} has only one least-squares solution x^ \hat{\vec{x}} , and it is given by:

x^=(ATA)1ATb. \hat{\vec{x}} = (A^T A)^{-1} A^T \vec{b}.

Theorem

A vector x^ \hat{\vec{x}} is a least-squares solution of Ax=b A \vec{x} = \vec{b} if and only if Ax^=projCol(A)(b) A \hat{\vec{x}} = \text{proj}_{\text{Col}(A)}(\vec{b}) .

Theorem

Let A A be an m×n m \times n matrix with orthogonal columns a1,,an \vec{a}_1, \dots, \vec{a}_n , and let bRm \vec{b} \in \mathbb{R}^m . The least-squares solution of Ax=b A \vec{x} = \vec{b} is x^ \hat{\vec{x}} , where the i i -th entry in x^ \hat{\vec{x}} is given by:

x^i=baiaiai. \hat{x}_i = \frac{\vec{b} \cdot \vec{a}_i}{\vec{a}_i \cdot \vec{a}_i}.