Recall our equation from least-squares:

Let’s use the QR factorization: .

Because is upper triangular we have

Thus, we get the equivalent linear system

Let’s solve for :

using .

The final solution is

Recall the normal equation:

The condition number is reduced from

to

This is a huge improvement!

Note that this method requires to be non-singular. This is equivalent to saying that should be full column rank.

The computational cost is .

Summary

  1. Orthogonality simplifies the problem: The orthonormality of means that projecting onto (or ) is straightforward. It turns complex geometric relationships into simple algebraic ones.
  2. Upper triangular structure: Solving systems with upper triangular matrices is simpler because you can solve for one variable at a time, starting from the last equation and moving upwards (back-substitution).
  3. Avoiding squaring the condition number: By not forming , we prevent the worsening of the condition number, leading to more accurate and stable solutions.
  4. Geometric projection without distortion: QR factorization allows us to project onto without distorting the space (since preserves lengths and angles due to its orthogonality).

Least-squares problems, QR factorization, QR using Householder transformations, QR using Givens transformations, Method of normal equation