Learn R Programming

varrank (version 0.5)

mi.data: Empirical Estimate of the Mutual Information from a Table of Counts

Description

This function estimates the mutual information from observed data

Usage

mi.data(X, Y, discretization.method=NULL, k=NULL)

Value

Mutual information estimate.

Arguments

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 discretization.

k

in case of purely continuous dataset, the mutual information can be computed using the k-nearest neighbours.

Author

Gilles Kratzer

Details

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.

References

Kraskov, A., Stogbauer, H. and Grassberger, P. (2004) Estimating mutual information. Physical Review E, 69:066138, 1–16.

Examples

Run this code
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")

Run the code above in your browser using DataLab