JuliaStats / HypothesisTests.jl

Hypothesis tests for Julia
MIT License
295 stars 87 forks source link

Problem with types in ExactPermutationTest #274

Closed SilvaSimaoPaulo closed 2 years ago

SilvaSimaoPaulo commented 2 years ago

When I try to use the ExactPermutationTest, for example: t = ExactPermutationTest([0.3, 0.31, 0.31, 0.32], [0.31, 0.29, 0.29, 0.30], x->10x) I got the following error ERROR: MethodError: no method matching HypothesisTests.PermutationTest(::Vector{Float64}, ::Vector{Vector{Float64}}) Stacktrace: [1] ExactPermutationTest(x::Vector{Float64}, y::Vector{Float64}, f::var"#7#9") @ HypothesisTests ~/.julia/packages/HypothesisTests/Dvf6v/src/permutation.jl:26 [2] top-level scope @ REPL[10]:1 It looks like it is passing the wrong argument types to the internal PermutationTest constructor.

wildart commented 2 years ago

The function must return a value for a given vector inputs, e.g. mean, but x->10x returns a scaled vector, hence the error.