Comparative numerical laboratory

Least Squares: Normal Equations vs QR Thinking — Chapter 7

Fit a line to the same data and compare residual and conditioning warnings.

\[ \min_{\alpha,\beta}\sum_i(\alpha+\beta x_i-y_i)^2. \]

Methods compared

MethodConvenienceInconvenience / warning
Normal equationsShort derivation and small system.Squares the condition number.
QR viewpointMore stable for serious least squares.More computational structure.
SVD viewpointBest rank and sensitivity diagnostic.More expensive.

Illustrative plot / animation

Numerical diagnostics

What the student must compare