Open
Description
The current (v0.33.16) implementation of entropy(p)
StatsBase.jl/src/scalarstats.jl
Lines 760 to 768 in 071d10a
returns weird results if the argument isn't a probability-like vector (i.e. sum(p) != 1
)
julia> entropy([0.5,0.5],2) # correct
1.0
julia> entropy([0.5,0.25],2) # this should throw an error?
1.0
julia> entropy([0.25,0.25],2) # this too, or at least some notion of normalization of p?
1.0
julia> entropy([0.125,0.125],2) # incorrect, no idea what's happening here
0.75
Metadata
Metadata
Assignees
Labels
No labels