Interactive demo · Bayesian and Probabilistic Machine Learning · Chapter 12

PCA: maximum variance, minimum error, and probabilistic PCA

Principal component analysis looks for the direction u along which the data vary most. Project every point onto a line through the mean: the variance of the projections, uTSu, and the mean squared distance from the points to the line always add up to the total variance Tr S, so the line that maximises the first also minimises the second (Bishop 2006, Sections 12.1.1 and 12.1.2). The other views show the principal axes, whitening, the generative model of probabilistic PCA, the EM algorithm for PCA and the maximum likelihood noise variance (Section 12.2).

View

Data

Direction θ of u (or drag on the plot)

Whitening: centre, rotate, rescale

Generate from the model

EM for PCA

Starting W

Noise variance σ² (log scale)

Scoreboard

Try these

S is the covariance matrix with divisor N (12.3), λ1 ≥ λ2 its eigenvalues and u1, u2 its unit eigenvectors. In two dimensions probabilistic PCA uses M = 1 latent variable, so its noise variance is the single discarded eigenvalue λ2; in D dimensions it is the average of the D − M discarded ones (12.46).

In the lecture notes