$$H(x) = -\sum x_i \log x_i$$
Shannon (1948), Sections 6-7; Cover & Thomas (2006), eq. (2.1). The
input is closed to unit total first and the closure constant is
reported, which is the only difference from Shanent.
Examples
V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Compshan(V)
#> $estimate
#> [1] 2.794209
#>
#> $closure
#> [1] 36
#>
#> $evenness
#> [1] 0.9314029
#>
#> $n
#> [1] 8
#>
#> $method
#> [1] "Shannon entropy of a composition -- Shannon (1948) Sec. 6"
#>
