Skip to contents

Estimate the conditional entropy of target variables given conditioning variables.

Usage

ce(data, target, conds, base = exp(1), type = c("cont", "disc"), k = 3)

Arguments

data

Observation data.

target

Integer vector of column indices for the target variables.

conds

Integer vector of column indices for the conditioning variables.

base

(optional) Logarithm base of the entropy. Defaults to exp(1) (nats). Use 2 for bits or 10 for dits.

type

(optional) Estimation method: "disc" for discrete entropy or "cont" for continuous entropy (KSG estimator).

k

(optional) Number of nearest neighbors used by the continuous estimator. Ignored when type = "disc".

Value

A numerical value.

Examples

infoxtr::ce(matrix(1:100,ncol=2),1,2)
#> [1] 1.402513