Learn R Programming

entropy (version 1.0.0)

entropy.shrink: Shrinkage entropy estimator

Description

entropy.shrink estimates the Shannon entropy H of the random variable Y from the corresponding observed counts y by plug-in of shrinkage estimate of the bin frequencies. freq.shrink estimates the bin frequencies from the counts y using a James-Stein-type shrinkage estimator. The default shrinkage target is the uniform, unless otherwise specified.

Usage

entropy.shrink(y, unit=c("log", "log2", "log10"), target=1/length(y), verbose=TRUE)
freqs.shrink(y, target=1/length(y), verbose=TRUE)

Arguments

y
vector of counts.
unit
the unit in which entropy is measured.
target
the shrinkage target for the frequencies (default: uniform distribution).
verbose
report shrinkage intensity and equivalent pseudocount.

Value

  • entropy.shrink returns an estimate of the Shannon entropy.

    freqs.shrink returns the underlying frequencies.

Details

The shrinkage estimator is a James-Stein-type estimator. It is essentially a entropy.Dirichlet estimator, where the pseudocount is estimated from the data. For details see Hausser and Strimmer (2008).

References

Hausser, J., and K. Strimmer. 2008. Entropy inference and the James-Stein estimator. Preprint (see http://strimmerlab.org/publications/entropy2008.pdf).

See Also

entropy.Dirichlet, entropy.NSB, entropy.ChaoShen, entropy.plugin.

Examples

Run this code
# load entropy library 
library("entropy")

# observed counts for each bin
y = c(4, 2, 3, 0, 2, 4, 0, 0, 2, 1, 1)  

# shrinkage estimate
entropy.shrink(y)

Run the code above in your browser using DataLab