Kullback Leibler Divergence
KLD.RdThis function calculates the Kullback Leibler Divergence $D(P\|Q)$
value between two distributions $P$ and $Q$, represented by their
two samples, X and Y. Both samples will have their density
inferred. The intended use-case is to compare 2D and 3D densities,
e.g.: to find interesting pairs of parameters within a bigger
distribution.
Usage
KLD(X, Y, de = c("copula", "ks", "mvtnorm"))Details
This estimate requires a method of density estimation, by default we use the copula based methods fitCopula and dCopulaPrior (which has a fairly high accuracy, but can be quite slow).
Effects of setting de to
"ks": density is estimated viaks::kde()"mvtnorm": density is estimated via manual kernel density estimation, using the multivariate Gaussian densitymvtnorm::dmvnorm