Learn R Programming

diggit (version 1.4.0)

mutualInfo: Mutual information

Description

This function estimates the mutual information between x and y given both are numeric vectors, between the columns of x if it is a numeric matrix, or between the columns of x and y if both are numeric matrixes

Usage

mutualInfo(x, y = NULL, per = 0, pairwise = FALSE, bw = 100, cores = 1, verbose = TRUE)

Arguments

x
Numeric vector or matrix
y
Optional numeric vector or matrix
per
Integer indicating the number of permutations to compute p-values
pairwise
Logical, wether columns of x and y should be compared in a pairwise maner. x and y must have the same number of columns
bw
Integer indicating the grid size for integrating the joint probability density
cores
Integer indicating the number of cores to use (1 for Windows-based systems)
verbose
Logical, whether progression bars should be shown

Value

Numeric value, vector or matrix of results

Details

This function estimates the mutual information between continuous variables using a fix bandwidth implementation

Examples

Run this code
x <- seq(0, pi, length=100)
y <- 5*sin(x)+rnorm(100)
cor.test(x, y)
mutualInfo(x, y, per=100)

Run the code above in your browser using DataLab