How do you show that the directions of maximum variance also minimise the squared reconstruction error of PCA? How do you derive the error for components in terms of the eigenvalues of the covariance matrix?
Unsupervised learning, Principal component analysis
Level L3 Intermediate. Length Long. Nature Mat Mathematical.
What's being asked
Whether you can link the two views of PCA through the Pythagoras identity.
Key idea
For an orthonormal , , so minimising the average error is the same as maximising , where is the covariance of the centred data.
Steps
- Centre the data and write . We reconstruct as where the columns of are orthonormal; is the best code for a fixed (least squares).
- By Pythagoras, and the two parts are orthogonal. So .
- Average over the data: . The first term does not depend on .
- Hence minimising means maximising , which is the total variance captured by the directions. This is the maximum variance view.
- The maximiser is the top eigenvectors of . Sketch: write , so with and ; this is largest when (the Ky Fan theorem). Then .
- So the minimum error is : the sum of the discarded eigenvalues.
- Sanity check: for the error is , and for it is the total variance .
Common mistakes
- Skipping the centring step. The identity used in these steps needs data with zero mean.
- Forgetting orthonormality, which is what makes and the Pythagoras step work.
- Writing the error as the sum of the retained eigenvalues. The retained ones give the captured variance.
How long your answer should be
Half a page; 5–6 minutes.
Last checked on 4 December 2026.
Read this
Previous in Unsupervised learning: Three points have pairwise distances , and . Use classical multidimensional scaling (MDS) with double centring to find the matrix and the 1-D embedding. Why is one dimension enough?
Next in Unsupervised learning: Factor analysis models , with and noise where is diagonal. (a) What covariance does this imply for ? (b) For observed variables and factors, how many free parameters does it use compared with a full covariance, taking the rotation ambiguity into account? (c) How does it differ from PCA?