Skip to content

Least Squares

When a system of equations has more equations than unknowns, no exact solution typically exists. The least squares method finds the best approximate solution by minimizing the total squared error between the left and right-hand sides. This chapter covers two complementary approaches: the normal equations (derived by multiplying both sides by ATA^T) and QR decomposition (which uses an orthonormal factorization to solve the same problem with better numerical properties).


Learning Objectives

By the end of this chapter you should be able to:

  1. Recognize an overdetermined system and explain why a direct solution is generally not possible.
  2. Define the residual ri=bi−(Ax)ir_i = b_i - (Ax)_i and state what quantity the least squares method minimizes.
  3. Derive the normal equations ATAx=ATbA^T A x = A^T b by multiplying both sides of Ax=bAx = b by ATA^T.
  4. Set up and solve the normal equations for a polynomial fitting problem using either an inverse matrix or Gaussian elimination.
  5. Define orthogonality (xTy=0x^T y = 0) and normality (xTx=1x^T x = 1) and verify that a given set of vectors is orthonormal.
  6. State the Kronecker delta and use it to express orthonormality compactly.
  7. Describe the QR decomposition A=QRA = QR and explain the role of QQ and RR.
  8. Apply the Gram-Schmidt process to compute QQ from the columns of AA.
  9. Derive the reduced system Rx=QTbRx = Q^T b and solve it by back substitution.
  10. Prove that QTQ=IQ^T Q = I and that the Gram-Schmidt process produces A=QRA = QR.

Chapter Sections

#SectionKey Concepts
1Why Least SquaresOverdetermined systems, residuals, minimizing squared error, best-fit line
2Normal EquationsDeriving ATAx=ATbA^T A x = A^T b, polynomial fitting examples, Gaussian elimination
3OrthonormalityOrthogonality, normality, Kronecker delta, verification
4QR DecompositionA=QRA = QR, Gram-Schmidt process, derivation of Rx=QTbRx = Q^T b, proofs
5QR Decomposition: Worked ExampleFull step-by-step QR solution of a polynomial fitting problem