The Latent Variable Perspective
Six sections of PCA and not one probability. §10.7 adds one, and the book is direct about why:
On the one hand, this approach may be appealing as it allows us to sidestep all the mathematical difficulties that come with probability theory, but on the other hand, a probabilistic model would offer us more flexibility and useful insights.
The payoff list is eight items long, and it is the same list Chapter 9 earned by going from §9.2 to §9.3: a likelihood, model comparison by marginal likelihood, a generative model, missing data by Bayes’ theorem, and a notion of novelty.
What you’ll learn
Section titled “What you’ll learn”- Equations 10.63–10.66: the generative process, and what it means that the arrow points from to .
- Equations 10.69–10.70b: — checked by ancestral samples, agreeing to relative, the Monte-Carlo floor.
- Equation 10.71: the cross-covariance is exactly .
- Equations 10.73–10.75: the posterior over the code. does not depend on — measured, exactly change across observations — which is the same structural fact page 907 measured for .
- A closed form the book does not give: , which for the ML is diagonal with entries — measured to .
- Equations 10.77–10.79: is page 1004’s divided by , matched to eight decimals.
- PPCA is PCA with shrinkage. The reconstruction is the PCA projection scaled by on each axis — measured to six decimals at four noise levels — and converges to PCA as .
Intuition: PCA describes the data, PPCA claims to have made it
Section titled “Intuition: PCA describes the data, PPCA claims to have made it”Everything before this page is a statement about a dataset you already have: here is the subspace that keeps the most variance. Nothing in it says what a new image would look like, or how surprised you should be by one.
PPCA writes down a story instead. Draw from a standard Gaussian; push it through an affine map; add noise. That story assigns a probability to every point in , which is what buys the eight items on the list — and it also commits you to claims that can be wrong.
flowchart LR Z["z ~ N(0, I)
Equation 10.65"] -->|"B z + mu"| XM["the mean of x"] XM -->|"+ noise, sigma^2 I"| X["x, Equation 10.66"] X -.->|"Bayes: Equations 10.73 to 10.75"| POST["p(z | x) = N(m, C)
C has no x in it"] Z --> J["the joint, Equation 10.72
cross-covariance exactly B"] X --> J J --> MARG["p(x) = N(mu, BB' + sigma^2 I)
Equations 10.69, 10.70b"]
§10.7.1 The generative process
Section titled “§10.7.1 The generative process”This is ancestral sampling: draw the parent, then the child.
§10.7.2 The likelihood, and why it needs the integral
Section titled “§10.7.2 The likelihood, and why it needs the integral”The conditional cannot be maximised over parameters, because it still mentions . Integrating it out:
Verified by running Equations 10.65 and 10.66 forward times with , :
| value | |
|---|---|
| empirical mean | |
| empirical covariance | |
| the same, relative to the largest entry | |
| Monte-Carlo floor, |
The gap is sampling noise of the size you would predict, not a discrepancy.
The joint, using (Equation 10.71):
§10.7.3 The posterior, and the thing it does not look at
Section titled “§10.7.3 The posterior, and the thing it does not look at”Gaussian conditioning (§6.5.1) gives
Note that the posterior covariance does not depend on the observed data .
§10.8’s maximum-likelihood parameters
Section titled “§10.8’s maximum-likelihood parameters”Equation 10.79 is page 1004’s divided by the number of directions it is spread across — “the average leftover variance that we cannot capture with the first principal components is treated as observation noise.” Measured:
Two consequences worth stating:
is back. Equation 10.78 ends in “an arbitrary orthogonal matrix”, which page 1004 measured: rotating leaves the reconstruction error at and the projector identical to . Here it means the maximum-likelihood solution is a whole family, and “PCA can identify the best lower-dimensional subspace in which the signals live, but not the signals themselves” (§10.8). ICA exists to break that tie by making non-Gaussian.
The margin note is a guarantee, not an observation. is positive semi-definite because is an average of the discarded eigenvalues, and the discarded ones are all below the kept ones by construction. The square root in Equation 10.78 is always real.
PPCA is PCA with shrinkage
Section titled “PPCA is PCA with shrinkage”Substituting into Equation 10.74 and reconstructing gives, per axis,
Measured against the prediction, four noise levels, five axes, and every cell matches:
| axis | axis | axis | axis | axis | |
|---|---|---|---|---|---|
-
Why can't the conditional in Equation 10.64 be used for maximum likelihood?
The likelihood must be a function of the data and the parameters only. Integrating z out gives a Gaussian with mean mu and covariance B B-transpose plus sigma-squared I — verified by 400,000 ancestral samples, agreeing to 2.1e-03 relative, which is the Monte-Carlo floor of 1.6e-03.
pch.quizShowAnswer
B — It still depends on the latent variables z, which are not data and not parameters — Equation 10.68b integrates them out — The likelihood must be a function of the data and the parameters only. Integrating z out gives a Gaussian with mean mu and covariance B B-transpose plus sigma-squared I — verified by 400,000 ancestral samples, agreeing to 2.1e-03 relative, which is the Monte-Carlo floor of 1.6e-03.
-
What is notable about the posterior covariance C in Equation 10.75?
The same structural fact page 907 measured for the Bayesian linear-regression posterior. Woodbury gives C as sigma-squared times the inverse of B-transpose B plus sigma-squared I, which for the maximum-likelihood B is diagonal with entries sigma-squared over lambda-m — measured to 9.7e-16. Uncertainty in inverse proportion to the variance the axis carries.
pch.quizShowAnswer
B — It does not depend on the observed x at all — measured, exactly zero change across 200 observations — The same structural fact page 907 measured for the Bayesian linear-regression posterior. Woodbury gives C as sigma-squared times the inverse of B-transpose B plus sigma-squared I, which for the maximum-likelihood B is diagonal with entries sigma-squared over lambda-m — measured to 9.7e-16. Uncertainty in inverse proportion to the variance the axis carries.
-
What is the maximum-likelihood noise variance of Equation 10.79?
Matched to eight decimals at M = 1, 5, 10, 20 and 40. It also guarantees the square root in Equation 10.78 is real: Lambda minus sigma-squared I is positive semi-definite because sigma-squared is an average of eigenvalues all smaller than the kept ones.
pch.quizShowAnswer
B — The average of the D minus M discarded eigenvalues — page 1004's J_M divided by D minus M — Matched to eight decimals at M = 1, 5, 10, 20 and 40. It also guarantees the square root in Equation 10.78 is real: Lambda minus sigma-squared I is positive semi-definite because sigma-squared is an average of eigenvalues all smaller than the kept ones.
-
How does PPCA's reconstruction differ from PCA's?
Twenty cells measured across four noise levels and five axes, all matching. The axes with the smallest eigenvalues shrink most, because they carry the least signal relative to the assumed noise. As sigma goes to zero the factors go to one and PPCA becomes PCA — though below about 1e-08 the required inverse is numerically singular and the limit stops being computable.
pch.quizShowAnswer
B — It is PCA's, shrunk on each axis by (lambda_m - sigma^2)/lambda_m — measured to six decimals — Twenty cells measured across four noise levels and five axes, all matching. The axes with the smallest eigenvalues shrink most, because they carry the least signal relative to the assumed noise. As sigma goes to zero the factors go to one and PPCA becomes PCA — though below about 1e-08 the required inverse is numerically singular and the limit stops being computable.
Exercises
Section titled “Exercises”Exercise 1 – Run the generative process forward
Section titled “Exercise 1 – Run the generative process forward”Exercise 2 – The posterior covariance sees no data
Section titled “Exercise 2 – The posterior covariance sees no data”Exercise 3 – Woodbury, and why C is diagonal
Section titled “Exercise 3 – Woodbury, and why C is diagonal”Exercise 4 – Equation 10.79 is a leftover average
Section titled “Exercise 4 – Equation 10.79 is a leftover average”Exercise 5 – Measure the shrinkage
Section titled “Exercise 5 – Measure the shrinkage”Recall card
Section titled “Recall card”- Section 10.7 puts a probabilistic model behind PCA, which buys a likelihood, model comparison, a generative story, missing-data handling and a notion of novelty — the same list Chapter 9 bought by going Bayesian.
- The arrow points from the code to the data. PPCA asserts a low-dimensional cause and then inverts it with Bayes’ theorem, where plain PCA simply computed the code as a function of the data.
- Integrating the latent variable out gives a Gaussian with the sample mean and covariance B B-transpose plus sigma-squared I, confirmed by 400,000 ancestral samples to within the Monte-Carlo floor.
- The cross-covariance between the data and the code is exactly B, which is what makes the joint in Equation 10.72 write down so cleanly.
- The posterior covariance does not depend on the observed data at all — measured, exactly zero change over 200 observations, the same structure page 907 found in Bayesian linear regression.
- Woodbury turns Equation 10.75 into an M-by-M inverse, and then the structure is visible: for the maximum-likelihood B it is diagonal with entries sigma-squared over lambda-m.
- So the posterior is uncertain in inverse proportion to the variance each axis carries, and you know that before seeing any data.
- Equation 10.79’s noise variance is the average of the discarded eigenvalues — page 1004’s reconstruction error divided by the number of directions it is spread over.
- Which is also why Equation 10.78’s square root is always real: an average of eigenvalues all below the kept ones is itself below them.
- PPCA is PCA with shrinkage. Each axis is scaled by lambda minus sigma-squared, over lambda — measured to six decimals across four noise levels, and hardest on the weakest axes.
- As sigma goes to zero the two coincide, but below about 1e-08 the matrix Equation 10.74 inverts is numerically singular. The limit is a statement, not a recipe.
- The arbitrary orthogonal R in Equation 10.78 is page 1004’s ambiguity again — PCA finds the subspace, not the signals, which is why ICA changes the prior on the code instead.
Next: Chapter 10 Worked Problems — eight problems built from claims the chapter makes, this module’s own.
pch.coffeeTagline
pch.coffeeCtapch.feedbackHeading
pch.feedbackSubheading