StatsBase.jl icon indicating copy to clipboard operation
StatsBase.jl copied to clipboard

inconsistency with Statistics in the presence of missing

Open tbeason opened this issue 3 years ago • 2 comments

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.

tbeason avatar Aug 05 '20 16:08 tbeason

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.

tbeason avatar Aug 05 '20 18:08 tbeason

Yes many functions should be rewritten to accept any iterator.

nalimilan avatar Aug 08 '20 09:08 nalimilan