StatsBase.jl
StatsBase.jl copied to clipboard
inconsistency with Statistics in the presence of missing
Right now, mean
and std
from Statistics return missing
if the input has an element that is missing
. skewness
and kurtosis
from this package error because their method signatures do not allow AbstractArray{Union{Missing,T},N} where {T<:Real,N}
. This is further a problem because an array of that type is not even guaranteed to have any missing
elements.
I propose to change the behavior so that the functions accept these arrays and propagate missing
if necessary (either naturally or short circuited).
I would think that maybe this just needs to be changed in src/common.jl
but am uncertain. If that is all that needs to happen, I can make the PR.
After also reading #581 I think this issue could be better summarized as saying that in general the type signatures of most of the functions in StatsBase should be relaxed.
Yes many functions should be rewritten to accept any iterator.