Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better support for skipmissing #153

Closed
pdeffebach opened this issue Mar 18, 2019 · 2 comments
Closed

Better support for skipmissing #153

pdeffebach opened this issue Mar 18, 2019 · 2 comments

Comments

@pdeffebach
Copy link
Contributor

I'm surprised things aren't set to work with any iterator. Am I doing something wrong?

x1 = [1, 2, 3, 4, missing]
x2 = [1, 1, 2, 3, missing]
julia> ApproximateTwoSampleKSTest(skipmissing(x1), skipmissing(x2))
ERROR: MethodError: no method matching ApproximateTwoSampleKSTest(::Base.SkipMissing{Array{Union{Missing, Int64},1}}, ::Base.SkipMissing{Array{Union{Missing, Int64},1}})
Closest candidates are:
  ApproximateTwoSampleKSTest(::Any, ::Any, ::Any, ::Any, ::Any) at C:\Users\Pdeffebach\.julia\dev\HypothesisTests\src\kolmogorov_smirnov.jl:143
Stacktrace:
 [1] top-level scope at none:0

Would be great to widen the type signatures where needed.

@nalimilan
Copy link
Member

Just like in StatsBase, this is probably restricted mostly for historical reasons, but in some cases accepting any iterator may require refactoring code a bit.

In the case of tests taking multiple arrays, there's also the problem that missing values are unlikely to appear in the same place in both inputs. So it may be better to use df = DataFrame(x1=x1, x2=x2); sdf = view(df, completecases(df)); Test(df2.x1, df2.x2). See also JuliaLang/julia#30596.

@pdeffebach
Copy link
Contributor Author

Yeah I should get around to that PR. KS tests don't have any order attached to them, but presumably some tests here that do? Time series tests raise a number of issues I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants