LA 101
M05 · L04
Module 5: Orthogonality

Least Squares

When a system is overdetermined — more equations than unknowns — we can't solve it exactly. Instead we find the best approximation by minimizing the squared error.

01 / 10
LA 101
M05 · L04
The Problem

More Equations Than Unknowns

A is m×n with m > n. The vector b usually lies outside the column space of A. No x satisfies Ax = b exactly.

Least Squares
\hat{\mathbf{x}} = \arg\min_{\mathbf{x}} \|\mathbf{b} - A\mathbf{x}\|^2
02 / 10
LA 101
M05 · L04
Geometric View

Project onto C(A)

The closest point in C(A) to b is its orthogonal projection p = Ax̂. The residual r = b − p is perpendicular to every column of A.

p
projection of b
⊥
r ⊥ C(A)
x̂
least squares sol.
03 / 10
LA 101
M05 · L04
The Key Formula

Normal Equations

Setting Aᵀ(b − Ax̂) = 0 gives the normal equations. When A has full column rank, the unique solution is:

Normal Equations
\hat{\mathbf{x}} = (A^T A)^{-1} A^T \mathbf{b}
04 / 10
LA 101
M05 · L04
Projection Matrix

P = A(AᵀA)⁻¹Aᵀ

Key Properties
P² = P (idempotent) · Pᵀ = P (symmetric)
Pythagorean Split
‖b‖² = ‖Pb‖² + ‖(I−P)b‖² — projection and residual are orthogonal
05 / 10
LA 101
M05 · L04
Application

Linear Regression

Fitting b = x₁ + x₂t to m data points is exactly least squares. The design matrix A has a column of ones and a column of t values.

  • Normal equations → intercept x̂₁ and slope x̂₂
  • Extends to polynomials, multiple predictors
  • Weighted regression: minimize ‖W(b − Ax)‖²
  • Residual ‖b − Ax̂‖² / (m−n) estimates noise variance
06 / 10
LA 101
M05 · L04
Numerical Stability

QR beats AᵀA

Forming AᵀA squares the condition number. Use QR instead: write A = QR, then solve Rx̂ = Qᵀb by back-substitution.

κ(A)²
via AᵀA
vs
 
κ(A)
via QR
07 / 10
LA 101
Knowledge Check

Check what stuck

Four questions from this lesson. Answer to see why — the explanation appears whether you were right or wrong. Nothing is scored or saved.

Question 1 of 0
Score 0/0

08 / 10
LA 101
M05 · L04
Signal Processing

Least Squares in Practice

  • Channel estimation — pilot symbols → ĥ = (ΦᵀΦ)⁻¹Φᵀy
  • Beamforming — weights minimizing ‖d − Aw‖²
  • System identification — FIR/AR model fitting from I/O data
  • GPS positioning — overdetermined range equations
  • SVD — minimum-norm solution for rank-deficient A
09 / 10
LA 101
Up Next
Lesson 4 Complete

Module 5 Done!

You've completed Module 5: Orthogonality — projections, Gram-Schmidt, orthogonal matrices, and least squares. These tools form the backbone of modern data analysis and signal processing.

10 / 10