Why do maximizing variance and minimizing reconstruction error lead to the same PCA subspace?

Quick Overview

Asks why maximizing projected variance and minimizing squared reconstruction error select the same PCA subspace. Tests fluency with orthogonal projections, covariance traces and eigenvectors, and awareness of the assumptions the equivalence depends on.

Why do maximizing variance and minimizing reconstruction error lead to the same PCA subspace?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

PCA on centered data can be defined in two ways: find the $k$-dimensional subspace that captures the most variance of the projected points, or find the $k$-dimensional subspace that gives the smallest squared reconstruction error when each point is replaced by its projection. Why do maximizing variance and minimizing reconstruction error lead to the same PCA subspace? ```hint Split each point Write each centered point as its projection onto the subspace plus the residual left over, and ask how those two pieces sit relative to each other geometrically. ``` ```hint Look for a fixed quantity Express both objectives with the covariance matrix and a trace. One term in the resulting identity does not depend on which subspace you choose. ``` ### What a Strong Answer Covers - The decomposition of each point into a projection and a residual, and why their squared lengths add. - The identity that links total variance, projected variance and reconstruction error once you sum over the data, and which of its terms is constant. - The common optimum of both objectives in terms of the covariance eigendecomposition, with the captured and discarded amounts. - The assumptions the equivalence needs (centering, squared Euclidean loss, orthogonal projection) and what changes when one is dropped. ### Follow-up Questions - What happens to the equivalence if you skip centering, and how does fitting an affine subspace fix it? - Why does a linear autoencoder trained with MSE recover the PCA subspace but not necessarily the principal directions themselves? - If you minimize the sum of absolute residuals instead of squared ones, do you still get PCA? - When is the optimal $k$-dimensional subspace not unique?

Overview: Asks why maximizing projected variance and minimizing squared reconstruction error select the same PCA subspace. Tests fluency with orthogonal projections, covariance traces and eigenvectors, and awareness of the assumptions the equivalence depends on.

General logo
General
Nov 24, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

PCA on centered data can be defined in two ways: find the kk-dimensional subspace that captures the most variance of the projected points, or find the kk-dimensional subspace that gives the smallest squared reconstruction error when each point is replaced by its projection. Why do maximizing variance and minimizing reconstruction error lead to the same PCA subspace?

What a Strong Answer Covers Guidance

  • The decomposition of each point into a projection and a residual, and why their squared lengths add.
  • The identity that links total variance, projected variance and reconstruction error once you sum over the data, and which of its terms is constant.
  • The common optimum of both objectives in terms of the covariance eigendecomposition, with the captured and discarded amounts.
  • The assumptions the equivalence needs (centering, squared Euclidean loss, orthogonal projection) and what changes when one is dropped.

Follow-up Questions Guidance

  • What happens to the equivalence if you skip centering, and how does fitting an affine subspace fix it?
  • Why does a linear autoencoder trained with MSE recover the PCA subspace but not necessarily the principal directions themselves?
  • If you minimize the sum of absolute residuals instead of squared ones, do you still get PCA?
  • When is the optimal kk -dimensional subspace not unique?