entropy.data | R Documentation |
This function empirically estimates the Shannon entropy from a table of counts using the observed frequencies.
entropy.data(freqs.table)
freqs.table |
a table of counts. |
The general concept of entropy is defined for probability distributions. The 'entropy.data' function estimates empirical entropy from data. The probability is estimated from data using frequency tables. Then the estimates are plug-in in the definition of the entropy to return the so-called empirical entropy. A common known problem of empirical entropy is that the estimations are biased due to the sampling noise. This is also known that the bias will decrease as the sample size increases.
Shannon's entropy estimate on natural logarithm scale.
Gilles Kratzer
library("varrank") rv <- rnorm(n = 100, mean = 0, sd = 2) entropy.data(freqs.table = discretization(data.df = rv, discretization.method = "fd", frequency = TRUE)[[1]])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.