R/utility.R
entropy.Rd
Entropy of a distribution
entropy(p, base = 2)
Discrete probability distribution
Desired base for entropy, eg, 2 for bits
Calculated Shannon entropy
entropy(c(0.5, 0.5)) #> [1] 1 entropy(c(0.9, 0.1)) #> [1] 0.4689956