Learn R Programming

SCCI (version 1.2)

conditionalShannonEntropy: Conditional Shannon Entropy

Description

Calculates the Shannon entropy of a discrete random variable \(X\) conditioned on a discrete (possibly multivariate) random variable \(Y\).

Usage

conditionalShannonEntropy(x, y)

Arguments

x

A discrete vector.

y

A data frame.

Examples

Run this code
# NOT RUN {
set.seed(1)
x = round((runif(1000, min=0, max=5)))
Y = data.frame(round((runif(1000, min=0, max=5))), round((runif(1000, min=0, max=5))))
conditionalShannonEntropy(x=x,y=Y) ## 2.411972
# }

Run the code above in your browser using DataLab