Chapter 5: The Grand Unification — How Variance Maximization Births the Eigenvalue Equation
We have arrived at the intellectual climax of the course. In Chapters 1 and 2, we started with a purely practical goal—compressing data with the smallest possible orthogonal reconstruction error—and proved via the Pythagorean theorem that it is equivalent to maximizing projected variance over all unit vectors . In Chapters 3 and 4, we explored eigenvectors as axes of pure geometric stretch.
Now we ask the question that unites both paths: Why does maximizing variance subject to produce the exact eigenvalue equation ? Even more remarkably, why does the Lagrange multiplier introduced solely to enforce the unit-length constraint turn out to equal the exact variance along ?
In this Article
- 1. Formulating the Constrained Optimization Problem
- 2. Geometric Proof: Kissing Contours and Parallel Gradients
- 3. Calculus Proof: Differentiating the Lagrangian L(u, λ)
- 4. The Payoff: Proving uᵀCu = λ and Ranking Principal Components
- 5. Deflation: Why the 2nd Principal Component Is the 2nd Eigenvector
- 6. Complete Worked Numerical Example
- 7. Active Recall Check and Key Takeaways
1. Formulating the Constrained Optimization Problem
Why can we not simply maximize without constraints? Because is quadratic in the length of : if you replace with , the value of explodes by without rotating the line at all! To optimize direction rather than vector length, we must lock onto the unit hypersphere :
2. Geometric Proof: Kissing Contours and Parallel Gradients
Imagine walking around the unit circle while reading the height of the variance function . If the level curve of crosses the unit circle at an angle, you can slide along the circle in the uphill direction to reach a higher variance.
u2 ^
| . - ~ ~ - . <-- Variance contour u^T C u = lambda_1
| . ' * ' .
+----+--'---------/(*)-------'--+
/ |/ / \ \ Grad f = 2 C u and Grad g = 2 u
| 0 0 \ | point in the EXACT SAME direction!
\ /| \ / Therefore: C u = lambda u !
+--/-+------------------+-------+
| Unit Circle u^T u = 1
At the exact point of maximum variance, the elliptical contour of must kiss (be tangent to) the unit circle . Because two tangent curves share the same normal line, their gradient vectors must be parallel:
3. Calculus Proof: Differentiating the Lagrangian L(u, λ)
To write this algebraically, we form the Lagrangian function by subtracting from our objective:
Using the matrix calculus identities (for symmetric ) and , we set the gradient with respect to to zero:
Every stationary point of directional variance on the unit sphere is an eigenvector of the covariance matrix !
4. The Payoff: Proving uᵀCu = λ and Ranking Principal Components
A symmetric matrix has orthonormal eigenvectors with eigenvalues . Which eigenvector maximizes ? Left-multiply by and use :
The eigenvalue IS the projected variance! Therefore:
- The eigenvector with the largest eigenvalue is the global maximum of variance (and global minimum of orthogonal reconstruction error)—this is Principal Component 1 (PC1).
- The eigenvector with the smallest eigenvalue is the direction of minimum variance.
5. Deflation: Why the 2nd Principal Component Is the 2nd Eigenvector
To find the second principal component , we maximize subject to both and orthogonality to the first component, . Forming the two-constraint Lagrangian and differentiating yields . Taking the dot product with shows , leaving among directions orthogonal to —whose best solution is !
6. Complete Worked Numerical Example
Suppose a centered 2D dataset has total scatter and covariance matrix .
- Solve : , giving and .
- Maximum Variance & Minimum Error along PC1 ():
- Projected variance along : .
- Mean squared reconstruction error when compressing to PC1 (by Chapter 2 Pythagorean theorem): !
Notice that remarkable duality: when you keep the top principal components, the captured variance is and the discarded reconstruction error is the sum of the discarded eigenvalues !
7. Active Recall Check and Key Takeaways
Quick Check: Test Your Understanding
Question: A 4D dataset has covariance eigenvalues . If we project the dataset onto the 2D plane spanned by PC1 and PC2, what is the captured variance and what is the mean squared orthogonal reconstruction error?
Answer: The captured variance is , and by the Pythagorean theorem the mean squared orthogonal reconstruction error is the sum of the discarded eigenvalues: .
- Chapter Microlearnings: Dive deeper into 5.1 Why uᵀu = 1 Is Essential, 5.2 Kissing Contours and Lagrange Multipliers, and 5.3 Why λ Equals Projected Variance.
- Canonical References: See Wikipedia Reference on the Rayleigh Quotient and Wikipedia Reference on Lagrange Multipliers.
Take a Quiz Based on This Article
Test your understanding with AI-generated questions tailored to this content
Adaptive Learning with SynLearn
Explore this article through guided practice that adapts to your answers