shannon.entropy: Shannon entropy

Description Usage Arguments Details Value Note Author(s) References Examples

View source: R/tools.R

Description

Calculates the Shannon entropy for a probability distribution

Usage

1

Arguments

p

A vector of probabilities (must sum to ~1)

Details

None

Value

Returns a numeric value for the Shannon entropy of the supplied probability distribution

Note

None

Author(s)

Loyal A. Goff

References

None

Examples

1
2
3
	x<-sample(1:500,50)
	p<-x/sum(x)
	shannon.entropy(p)

cummeRbund documentation built on Nov. 8, 2020, 7:53 p.m.