Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(RANN) | |
kl <- function(X,Y) { | |
"""Estimate the Kullback-Leibler divergence between two multivariate samples. | |
adapted for R from python code at https://gist.github.com/atabakd/ed0f7581f8510c8587bc2f41a094b518 | |
as described in Fernando Pérez-cruz, Kullback-Leibler Divergence Estimation of Continuous Distributions, | |
Proceedings of IEEE International Symposium on Information Theory, 2008, 1666--1670 |