powered by
Reports the entropy of a vector of probabilities, in bits. Probabilities should sum to one. Probabilities equalling zero will be ignored.
Entropy(p)
Numeric vector specifying probabilities of outcomes.
Entropy of the specified probabilities, in bits
# NOT RUN { Entropy(rep(0.5, 2)) # = 1 Entropy(c(1/4, 1/4, 0, 1/4, 1/4)) # = 2 # }
Run the code above in your browser using DataLab