3/13
Part 2 of 7 · Continuous distributionsLearn and do

For densities, the sum becomes an integral

TTIC's information theory notes define the continuous version the same way, when both distributions have density functions: the integral of p(x) log(p(x) / q(x)). For two normals it has a closed form, which the same notes work out:

DKL(N(μ1,σ12) ∥ N(μ2,σ22))=log⁡σ2σ1+σ12+(μ1−μ2)22σ22−12D_{\mathrm{KL}}\big(\mathcal{N}(\mu_1, \sigma_1^2) \,\|\, \mathcal{N}(\mu_2, \sigma_2^2)\big) = \log\frac{\sigma_2}{\sigma_1} + \frac{\sigma_1^2 + (\mu_1 - \mu_2)^2}{2\sigma_2^2} - \frac{1}{2}

Predict

Two normals share a mean, with spreads 1 and 2. Which costs more: KL(wide ‖ narrow) or KL(narrow ‖ wide)?

Pick an answer above to see the rest