Learn R Programming

distr6 (version 1.3.1)

entropy: Distribution Entropy

Description

(Information) Entropy of a distribution

Usage

entropy(object, base = 2)

Arguments

object

Distribution.

base

base of the entropy logarithm, default = 2 (Shannon entropy)

Value

Entropy with given base as a numeric.

R6 Usage

$entropy(base = 2)

Details

The entropy of a (discrete) distribution is defined by $$- \sum (f_X)log(f_X)$$ where \(f_X\) is the pdf of distribution X, with an integration analogue for continuous distributions. The base of the logarithm of the equation determines the type of entropy computed. By default we use base 2 to compute entropy in 'Shannons' or 'bits'.

If an analytic expression isn't available, returns error. To impute a numerical expression, use the CoreStatistics decorator.

See Also

CoreStatistics and decorate