Gram-Schmidt Process
The Gram-Schmidt process converts any set of independent vectors into an orthogonal basis for the same space.
Algorithm
Given vectors a1,a2,…,an:
-
q1=∥a1∥a1
-
q2=∥⋯∥a2−(a2⋅q1)q1
-
q3=∥⋯∥a3−(a3⋅q1)q1−(a3⋅q2)q2
Each step: subtract the projections onto all previous q's, then normalize.
QR Factorization
Gram-Schmidt produces:
A=QR
Where:
- Q — orthogonal matrix (columns are orthonormal)
- R — upper triangular matrix
Why QR Is Better Than A
- QTQ=I (easy to invert)
- Solving Ax=b becomes Rx=QTb (no need for ATA)