Md. Asif Uddin
    I.13.X05

    Where Jensen's inequality is tight

    symbolic▲▲△

    Derive the ELBO from Jensen’s inequality, and state exactly when the inequality is an equality. Then check the condition for the model of I.13.B01: show that log⁡p(x,z)−log⁡p(z∣x)\log p(\vec x,z)-\log p(z\mid\vec x) takes the same value at every zz, and find it.

    Hint

    The logarithm is strictly concave, so log⁡E[Y]=E[log⁡Y]\log\E[Y]=\E[\log Y] only when YY is constant.

    Solution

    Write Y=p(x,z)/q(z∣x)Y=p(\vec x,\vec z)/q(\vec z\mid\vec x) with z∼q\vec z\sim q. Its mean is ∫p(x,z) dz=p(x)\int p(\vec x,\vec z)\,d\vec z=p(\vec x), so by Jensen’s inequality (Jensen's inequality 0.IT.05)

    log⁡p(x)=log⁡Eq[Y]≥Eq[log⁡Y]=ELBO⁡(q).\begin{aligned} \log p(\vec x)&=\log\E_q[Y]\\ &\geq\E_q[\log Y]=\operatorname{ELBO}(q). \end{aligned}

    Because log⁡\log is strictly concave, equality holds exactly when YY is the same number for every z\vec z that qq can draw. Then q(z∣x)∝p(x,z)q(\vec z\mid\vec x)\propto p(\vec x,\vec z), and normalising gives q=p(x,z)/p(x)q=p(\vec x,\vec z)/p(\vec x), the posterior. The constant is p(x)p(\vec x).

    For the linear model, with qq the posterior, YY is p(x,z)/p(z∣x)p(\vec x,z)/p(z\mid\vec x), which by Bayes’ rule is p(x)p(\vec x) at every zz. The script evaluates log⁡p(z)+log⁡p(x∣z)−log⁡N(z;0.866025,0.25)\log p(z)+\log p(\vec x\mid z)-\log\mathcal N(z;0.866025,0.25) at z=−1z=-1, 00, 0.50.5 and 22 and gets −3.531024-3.531024 each time, the log-evidence.

    For any other qq the ratio varies with zz, and the spread of log⁡Y\log Y is what Jensen’s inequality charges. The first derivation in proposition 2 shows that the charge is exactly KL⁡(q ∥ p(z∣x))\KL(q\,\|\,p(\vec z\mid\vec x)).

    Draws on