MTH168 Mathematics II

Mathematics IIUnit 78 min read

Least Squares & Projections: Theory, Methods & Applications

Unit 7 of Mathematics II covers the mathematical foundations of least squares approximation and orthogonal projections, including the normal equations, projection matrices, and applications in data fitting and error minimization.

Key Concepts & Definitions

1. Least Squares Problem

  • Definition: Given an overdetermined system (where , ), the least squares solution minimizes the sum of squared errors (residuals):
  • Interpretation: When has no exact solution (inconsistent system), we find the best approximate solution that minimizes the error.

2. Normal Equations

  • The least squares solution satisfies the normal equations:
  • Derivation: Using calculus (minimizing ) or projection theory.
  • Conditions for Solution:
    • If is invertible, then .
    • If is singular, the solution is not unique (infinite solutions exist).

3. Projection onto a Subspace

  • Orthogonal Projection: Given a vector and a subspace , the projection of onto is: where is the least squares solution of (with ).
  • Projection Matrix: The matrix projects any vector onto the column space of .

4. Least Squares Error

  • The minimum error (residual norm) is:
  • Geometric Interpretation: The error vector is orthogonal to the column space of .

Methods for Solving Least Squares Problems

1. Direct Method (Normal Equations)

  • Steps:
    1. Compute and .
    2. Solve for .
  • Advantages:
    • Simple to implement for small systems.
  • Disadvantages:
    • Ill-conditioned when is nearly singular.
    • Computationally expensive for large .

2. QR Factorization Method

  • Steps:
    1. Factorize , where is orthogonal () and is upper triangular.
    2. Solve (using back substitution).
  • Advantages:
    • Numerically stable (avoids squaring condition number).
    • Efficient for large systems.
  • Disadvantages:
    • Requires QR decomposition (extra computation).

3. Singular Value Decomposition (SVD) Method

  • Steps:
    1. Factorize , where are orthogonal, is diagonal.
    2. The least squares solution is: where is the pseudoinverse of .
  • Advantages:
    • Most numerically stable.
    • Handles rank-deficient matrices well.
  • Disadvantages:
    • Computationally intensive.
Method Stability Best For Computational Cost
Normal Equations Poor Small, well-conditioned Low
QR Factorization Good Medium/large systems Moderate
SVD Excellent Ill-conditioned/rank-deficient High

Worked Examples

Example 1: Least Squares Solution Using Normal Equations

Problem: Find the least squares solution of , where

Solution:

  1. Compute and :
  2. Solve :
  3. Least squares solution:
  4. Least squares error: (Full computation omitted for brevity.)

Example 2: Orthogonal Projection

Problem: Find the orthogonal projection of onto .

Solution: The projection formula is:

  1. Compute dot products:
  2. Projection:
  3. Orthogonal decomposition: (Verify: .)

Applications of Least Squares

  1. Data Fitting (Regression):

    • Fitting a line to data points .
    • Example: Given points , solve: The least squares solution gives the best-fit line coefficients .
  2. Computer Graphics:

    • Curve fitting, surface reconstruction.
  3. Signal Processing:

    • Noise reduction, filtering.
  4. Machine Learning:

    • Linear regression, support vector machines (SVM).

Exam Tip

  1. Understand the Geometry:

    • The least squares solution minimizes the distance between and the column space of .
    • The error is orthogonal to .
  2. Normal Equations vs. QR/SVD:

    • For small problems, normal equations are acceptable.
    • For large or ill-conditioned problems, always prefer QR or SVD in exams.
  3. Projection Formula:

    • Memorize:
    • For a single vector , use:
  4. Error Calculation:

    • The least squares error is . Compute it using:
    • Alternatively, use the residual formula:
  5. Common Pitfalls:

    • Non-invertible : If is singular, the system has infinitely many solutions. Use SVD or QR.
    • Overfitting: In regression, too many parameters can lead to poor generalization. Least squares alone does not prevent this.
  6. Past Exam Patterns:

    • Direct computation: Solve for given and (30-40% of questions).
    • Projection problems: Given and , find (20%).
    • Error calculation: Compute (20%).
    • Theoretical questions: Explain why least squares works (10-20%).

Summary Table for Quick Revision

Concept Formula Key Idea
Least Squares Solution Minimizes
Normal Equations Derived from calculus/minimization
Projection Matrix Projects any onto
Least Squares Error Orthogonal to
Orthogonal Projection Breaks into parallel + perpendicular parts

Based on the TU BSc CSIT syllabus for Mathematics II (MTH168), unit 7.

Discussion

Loading…