shannon.entropy {cummeRbund} | R Documentation

## Shannon entropy

### Description

Calculates the Shannon entropy for a probability distribution

### Usage

    shannon.entropy(p)

### 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

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

[Package cummeRbund version 2.29.0 Index]