Householder reflections
Given any vector $\v a = (a_1, \ldots, a_{k-1}, a_k, a_{k+1}, \ldots, a_m)\in \R^m$, we can get $\v b = (a_1, \ldots, a_{k-1}, γ, 0, \ldots, 0)\in \R^m$ where $γ = \pm\sqrt{a_k^2 + a_{k+1}^2 + \ldots + a_m^2}$ by applying the Householder reflection for $\v u = \v a - \v b = (0,\ldots,0, a_k - γ, a_{k+1}, \ldots, a_m)$. Note that $H_u$ has the block matrix form $$ \begin{align*} H_\v u = \pmat{I_{k-1} & 0 \\ 0 & *} \end{align*} $$ so the first $k-1$ components are preserved under $H_\v u$.
Therefore we can kill off all subdiagonal entires of a matrix this way: $$ \begin{align*} \pmat{*&*&* \\ *&*&* \\ *&*&* \\ *&*&*} \xrightarrow{H_1} \pmat{\bullet&\bullet&\bullet \\ 0&\bullet&\bullet \\ 0&\bullet&\bullet \\ 0&\bullet&\bullet} \xrightarrow{H_2} \pmat{*&*&* \\ 0&\bullet&\bullet \\ 0&0&\bullet \\ 0&0&\bullet} \xrightarrow{H_3} \pmat{*&*&* \\ 0&*&* \\ 0&0&\bullet \\ 0&0&0} \end{align*} $$ (Legend: $*$ remains the same as the previous matrix; $\bullet$ has changed through a rotation.)
Hence $$ \begin{align*} R = H_m\ldots H_2 H_1 A \implies A = \underbrace{(H_m \ldots H_2H_1)^T}_{Q} R. \end{align*} $$
Example (QR factorisation using Householder reflections)
Practicality:
-
Numerically, don't compute the matrix of $H_\v u$! Always perform vector products $\v v - \frac{2}{\|u\|^2}\v u \v u^T \v v$ instead.
-
How to choose the sign of $γ$?
-
For hand computation, choose $\sign γ = \sign a_k$ to make numbers smaller.
-
For numerical computation, choose $\sign γ = -\sign a_k$ to make numbers larger for stability.
-