Description Usage Arguments Value
shannonEntropy
calculates the Shannon entropy for a vector
of observations, using empirical probability of each unique value
as its probability. The input vector is assumed to contain
observations from a discrete distribution. If working with continuous
data, the observations should be discretized prior to using this function.
The base two logarithm is used, so the unit for the result is bits.
1 2 | shannonEntropy(observations, isCounts = FALSE, pseudocount = 1,
normalized = FALSE)
|
observations |
The observed values for which to calculate entropy. |
isCounts |
Does |
pseudocount |
Value of pseudocount to substitute for zeros; this has
meaning if and only if |
normalized |
Whether to normalize the entropy (into [0, 1]). |
The Shannon entropy of the empirical distribution defined by the given observations.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.