Linear Algebra: VIII Gram-Schmidt and QR Decomposition
Gram–Schmidt and QR Decomposition Suppose that $\{ \vec{v}_1, \ldots, \vec{v}_n \}$ is a set of linearly independent column vectors in $\mathbb{R}^n$, and let $A$ be an $n$ by $n$ square matrix: $$ A = [\vec{v}_1 \ \cdots \ \vec{v}_n] $$ Then the Gram--Schmidt process produces an orthonormal basis $$ \{ \hat{q}_1, \ldots, \hat{q}_n \} $$ which can be written as the $n$ by $n$ orthonormal matrix: $$ Q = [\hat{q}_1 \ \cdots \ \hat{q}_n] $$ Let $\hat{v}_1$ be a unit vector. Then the vector $$ (I - \hat{v}_1 \hat{v}_1^\top)\hat{v}_2 $$ Is orthogonal to $\hat{v}_1$ since $$ \hat{v}_1^\top (I - \hat{v}_1 \hat{v}_1^\top)\hat{v}_2 = \hat{v}_1^\top\hat{v}_2 - (\hat{v}_1^\top\hat{v}_1)\hat{v}_1^\top\hat{v}_2 = \hat{v}_1^\top\hat{v}_2 - \hat{v}_1^\top\hat{v}_2 = 0 $$ Using this idea, we construct an orthonormal basis: $$ \hat{q}_1 = \frac{\vec{v}_1}{\|\vec{v}_1\|} $$ $$ \vec{q}_2 = (I - \hat{q}_1 \hat{q}_1^\top)\vec{v}_2, \qquad \hat{q}_2...