mut_info_knn {YEAB} | R Documentation |
Mutual Information for Continuous Variables using kNN
Description
Mutual Information for Continuous Variables using kNN
Usage
mut_info_knn(x, y, k = 5, direct = TRUE)
Arguments
x |
Numeric vector. |
y |
Numeric vector. |
k |
Number of nearest neighbors to use; default is 5. |
direct |
Logical; if |
Value
Numeric; an estimate of the mutual information.
Examples
set.seed(123)
x <- rnorm(1000)
y <- rnorm(1000)
# Close to 0 if they are independent
mut_info_knn(x, y, k = 5)
y <- 100 * x + rnorm(length(x), 0, 12)
# Far from 0 if they are not independent
mut_info_knn(x, y, k = 5)
[Package YEAB version 1.0.6 Index]