View source: R/tree_distance_utilities.R
Entropy | R Documentation |
Calculate the entropy of a vector of probabilities, in bits. Probabilities should sum to one. Probabilities equalling zero will be ignored.
Entropy(...)
Ntropy(...)
... |
Series of numerics, or single numeric vector, specifying
probabilities of outcomes (for |
Entropy()
and Ntropy()
return the entropy of the specified
probabilities or counts, in bits.
Martin R. Smith (martin.smith@durham.ac.uk)
Entropy(1/2, 0, 1/2) # = 1
Entropy(rep(1/4, 4)) # = 2
Ntropy(c(2, 2, 0, 2, 2)) # = 2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.