mi-data.Rd
This function estimates the mutual information from observed data
mi.data(X, Y, discretization.method=NULL, k=NULL)
X | a data frame containing only numeric or continuous variables. |
---|---|
Y | a data frame containing only numeric or continuous variables. |
discretization.method | a character vector giving the discretization method to use. See |
k | in case of purely continuous dataset, the mutual information can be computed using the k-nearest neighbours. |
The mutual information estimation is computed from the observed frequencies through a plugin estimator based on entropy or using the estimator described in A. Kraskov, H. Stogbauer and P.Grassberger (2004) when the data frame is exclusively made of continuous variables.
The plugin estimator is I(X, Y) = H (X) + H(Y) - H(X, Y), where H() is the entropy computed with entropy.data
.
Mutual information estimate.
Kraskov, A., Stogbauer, H. and Grassberger, P. (2004) Estimating mutual information. Physical Review E, 69:066138, 1–16.
Y <- rnorm(n = 100, mean = 0, sd = 2) X <- rnorm(n = 100, mean = 5, sd = 2) mi.data(X = Y, Y = X, discretization.method = "sturges")#> [1] 0.3164374