Exact values where possible; six decimal places otherwise.
STATEMENT
Compute the log-evidence of one point under probabilistic PCA, then the
lower bound that four different encoder distributions give it, and confirm
that each gap is a KL divergence.
GIVEN
The four points of I.12 have covariance eigenvalues 4 and 1 along
u1=(0.8,0.6) and u2=(−0.6,0.8). The model has one latent
dimension, z∼N(0,1) and
x∣z∼N(wz,σ2I), at its maximum
likelihood σ2=1 and w=3u1. Take
x=(1,2). The four candidate encoder distributions are
N(0,1), N(0,41), N(23,1)
and N(23,41).
FIND
logp(x); the posterior of z; the ELBO for each candidate; the
gaps; and the two terms of the ELBO at the posterior.
STRATEGY
Use (I.13.2) for the evidence and the posterior, written in the
eigenbasis. For the ELBO, both terms of (I.13.4) have closed forms for a
Gaussian q with mean m and variance v.
SOLUTION
The evidence. The point has coordinates u1Tx=2
and u2Tx=1. The model’s covariance
wwT+I has eigenvalues 4 along u1 and
1 along u2, so its determinant is 4 and
and the reconstruction term is −log2π minus half of that. The price
of the code is 21(m2+v−1−logv) by (I.13.5). For the prior,
m=0 and v=1: the squared error averages to 8, the reconstruction
term is −log2π−4, the price is 0, and
ELBO=−5.837877.
The other three, computed the same way, are −5.031024, −4.337877 and
−3.531024.
The gaps. Subtracting from logp(x) gives 2.306853, 1.5,
0.806853 and 0. By (I.13.4) each must equal the KL divergence from
N(m,v) to the posterior N(0.866025,0.25). For the
prior,
At the posterior. The squared error averages to
5−6+3=2, so the reconstruction term is −log2π−1=−2.837877. The price
is 21(0.75+0.25−1−log0.25)=log2=0.693147. Their difference is
the evidence.
Answer
logp(x)=−3.531024; posterior N(0.866025,0.25); ELBOs
−5.837877, −5.031024, −4.337877, −3.531024; gaps 2.306853, 1.5,
0.806853, 0; at the posterior, reconstruction −2.837877 and price
0.693147.
Check — sanity
Every bound is below the evidence and the gaps are non-negative. The
correct width with mean 0 costs 1.5, which is
21(0.8660252)/0.25: with equal variances, the KL is the squared
distance between the means over twice the variance.
It checks all fifteen problems of the chapter and the numbers quoted in its
four propositions. It confirms the evidence by integrating
p(z)p(x∣z) numerically, and each gap against a separately
computed KL divergence.
Executed in CI. The digits above are the digits it printed.
Where this breaks
With a nonlinear decoder neither the evidence nor the posterior has a
closed form, and only the ELBO can be computed. The gaps above can be
seen only because this model is linear.
Variation
Every corner of the rectangle has ∣u1Tx∣=2 and
∣u2Tx∣=1, so all four have the same evidence, and
the posterior means are ±0.866025. The average log-likelihood over the
dataset is therefore also −3.531024.