lnn_entropy {rmi} | R Documentation |
Local Nearest Neighbor entropy estimator using Gaussian kernel and kNN selected bandwidth. Entropy is estimated by taking a Monte Carlo estimate using local kernel density estimate of the negative-log density.
lnn_entropy(data, k = 5, tr = 30, bw = NULL)
data |
Matrix of sample observations, each row is an observation. |
k |
Order of the local kNN bandwidth selection. |
tr |
Order of truncation (number of neighbors to include in entropy). |
bw |
Bandwidth (optional) manually fix bandwidth instead of using local kNN bandwidth selection. |
Loader, C. (1999). Local regression and likelihood. Springer Science & Business Media.
Gao, W., Oh, S., & Viswanath, P. (2017). Density functional estimators with k-nearest neighbor bandwidths. IEEE International Symposium on Information Theory - Proceedings, 1, 1351–1355.
set.seed(123) x <- rnorm(1000) print(lnn_entropy(x)) #analytic entropy print(0.5*log(2*pi*exp(1)))