shannon_conditional_entropy: Shannon Conditional Entropy

Description Usage Arguments Value Examples

View source: R/shannon.R

Description

Compute the base-b conditional entropy given joint p_xy and marginal p_y distributions.

Usage

1
shannon_conditional_entropy(p_xy, p_y, b = 2)

Arguments

p_xy

Dist specifying the joint distribution.

p_y

Dist specifying the y-marginal distribution.

b

Numeric giving the base of the logarithm.

Value

Numeric giving the Shannon conditional entropy.

Examples

1
2
3
4
5
6
7
xy <- Dist(c(10, 70, 15, 5))
x  <- Dist(c(80, 20))
y  <- Dist(c(25, 75))
shannon_conditional_entropy(xy, x)              # 0.5971072
shannon_conditional_entropy(xy, y)              # 0.5077571
shannon_conditional_entropy(xy, x, b = 3)       # 0.3767327
shannon_conditional_entropy(xy, y, b = 3)       # 0.3203591

rinform documentation built on April 1, 2018, 12:12 p.m.