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 b⃗∈Rm \vec{b} \in \mathbb{R}^m , the equation Ax⃗=b⃗ A \vec{x} = \vec{b} has a unique least-squares solution given by:

x⃗^=R−1QTb⃗. \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 a⃗1,…,a⃗n \vec{a}_1, \dots, \vec{a}_n , and let b⃗∈Rm \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=b⃗⋅a⃗ia⃗i⋅a⃗i. \hat{x}_i = \frac{\vec{b} \cdot \vec{a}_i}{\vec{a}_i \cdot \vec{a}_i}.