mutual_inf_cc {knnmi}R Documentation

Mutual information estimation

Description

Estimate the mutual information MI(X;Y) of the target X and features Y where X and Y are both continuous using k-nearest neighbor distances.

Usage

mutual_inf_cc(target, features, k = 3L)

Arguments

target

input vector.

features

input vector or matrix.

k

Integer number of nearest neighbors. The default value is 3.

Details

The features argument is a vector of the same size as the target vector, or a matrix whose column dimension matches the size of the target vector.

Value

Returns the estimated mutual information. The return value is a vector of size 1 if the features argument is a vector. If the features argument is a matrix then the return value is a vector whose size matches the number of rows in the matrix.

References

Alexander Kraskov, Harald Stögbauer, and Peter Grassberger. Phys. Rev. E 69, 066138 (2004). doi:10.1103/PhysRevE.69.066138

Examples


data(mutual_info_df)
set.seed(654321)
mutual_inf_cc(mutual_info_df$Yc, t(mutual_info_df$Zc_XcYc))
mutual_inf_cc(mutual_info_df$Xc, t(mutual_info_df$Zc_XcYc), k=5)




[Package knnmi version 1.0 Index]