6.3 Special Considerations for PCA
Centering, scaling, and how many components to keep.
These notes walk through the lecture slides. The original deck is unchanged; use (slides) on the course hub if you want that PDF.
Figures and notes follow Deisenroth, Faisal, and Ong, Mathematics for Machine Learning; Theodoridis; and Géron.
1. PCA and singular value decomposition (SVD)
Eigendecomposition. From the covariance , compute eigenvalues and eigenvectors . The are the principal components. Each is the variance along that component.
SVD. Factor the centered data matrix: . The right singular vectors are the principal components. The singular values on the diagonal of are the square roots of the eigenvalues of .
The two routes agree. That is the link between the maximum-variance view of PCA and the SVD of .
2. PCA and low-rank approximations
Because is the best rank- approximation of in the Frobenius sense,
is minimum.
So PCA also minimizes the sum of squared reconstruction errors. The same components that maximize variance are the ones that keep as much of the original points as an -dimensional picture can.
3. Latent variable perspective
So far PCA had no probabilistic model: maximum variance and projection only. A probabilistic model would:
- come with a likelihood, so noise in the observations is explicit;
- allow Bayesian model comparison via the marginal likelihood;
- treat PCA as a generative model (simulate new data);
- make connections to related algorithms straightforward;
- handle dimensions missing at random by Bayes;
- give a notion of how novel a new point is;
- extend cleanly, e.g. to a mixture of PCA models;
- recover the PCA of the earlier sections as a special case;
- allow a fully Bayesian treatment by integrating out parameters.
4. History of probabilistic PCA
A continuous latent lets you write PCA as a probabilistic latent-variable model. Tipping and Bishop (1999) called this probabilistic PCA (PPCA). It addresses most of the list above. Ordinary PCA — maximize projected variance, or minimize reconstruction error — is maximum likelihood in the noise-free limit.
5. The PPCA model
Assume a continuous latent with standard-normal prior , and a linear map to the observation :
where is Gaussian observation noise, , and . The conditional is
The generative process:
and
To draw a typical point, use ancestral sampling: first , then .
The joint is
6. An illustration of PPCA
Blue dots: two-dimensional PCA latents for MNIST digits “8”. Query any in that plane and generate (here and identity covariance). The image looks like an “8”.

Eight generated images sit with their latent coordinates. Where you query the latent plane changes shape, rotation, size.
Practice
-
In the SVD view of PCA, which factor of holds the principal components?
-
Besides maximizing variance, what reconstruction quantity does a rank- PCA minimize?
-
In PPCA, what extra random object appears that ordinary PCA never named, and what prior does it get?