cmi {bnclassify} | R Documentation |
Compute the (conditional) mutual information between two variables.
Description
Computes the (conditional) mutual information between two variables. If
z
is not NULL
then returns the conditional mutual information,
. Otherwise, returns mutual information,
.
Usage
cmi(x, y, dataset, z = NULL, unit = "log")
Arguments
x |
A length one character. |
y |
A length one character. |
dataset |
A data frame. Must contain x, y and, optionally, z columns. |
z |
A character vector. |
unit |
A character. Logarithm base. See |
Details
, where
is
Shannon's entropy.
Examples
data(car)
cmi('maint', 'class', car)
[Package bnclassify version 0.4.8 Index]