Entropy: Entropy in bits

View source: R/tree_distance_utilities.R

EntropyR Documentation

Entropy in bits

Description

Calculate the entropy of a vector of probabilities, in bits. Probabilities should sum to one. Probabilities equalling zero will be ignored.

Usage

Entropy(...)

Arguments

...

Numerics or numeric vector specifying probabilities of outcomes.

Value

Entropy() returns the entropy of the specified probabilities, in bits.

Author(s)

Martin R. Smith (martin.smith@durham.ac.uk)

Examples

Entropy(1/2, 0, 1/2) # = 1
Entropy(rep(1/4, 4)) # = 2

TreeDist documentation built on Oct. 26, 2023, 1:07 a.m.