Computes a divergence between two Gaussian mixtures of the same ambient
dimension. The Cauchy-Schwarz divergence
$$D_{\mathrm{CS}}(p, q) = \tfrac{1}{2}\log V(p, p)
+ \tfrac{1}{2}\log V(q, q) - \log V(p, q),$$
with \(V(p, q) = \int p(x) q(x)\, dx\), is closed-form, symmetric,
non-negative, and zero exactly when \(p \propto q\). The "kl" option
delegates to gmm_kld(), a Monte-Carlo estimate of the asymmetric
Kullback-Leibler divergence \(\mathrm{KL}(p \Vert q)\).
Usage
gmm_divergence(p, q, type = c("cs", "kl"), n_mc = 5000L)Value
For type = "cs", a non-negative numeric scalar. For type = "kl",
the list returned by gmm_kld().