entropy {mlf}R Documentation

Entropy

Description

Estimates uncertainty in univariate probability distribution.

Usage

entropy(x, bins)

Arguments

x

numeric or discrete data vector

bins

specify number of bins if numeric or integer data class.

Examples

# Sample numeric vector
a <- rnorm(25, 80, 35)
mlf::entropy(a, bins = 2)

# Sample discrete vector
b <- as.factor(c(1,1,1,2))
mlf::entropy(b)

[Package mlf version 1.2.1 Index]