You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using HypothesisTests, StatsBase
function test(x)
pairwise(eachindex(x); symmetric=true) do j,i
pval = pvalue(SignedRankTest(x[i], x[j]))
pval, rand()
end
end
x = [rand(1000) for _=1:10]
test(x)
ERROR: TypeError: in typeassert, expected Matrix{<:Tuple{Union{Nothing, Float64, Int64}, Float64}}, got a value of type Matrix{Tuple{Real, Float64}}
Stacktrace:
[1] _pairwise(#unused#::Val{:none}, f::var"#29#30"{Vector{Vector{Float64}}}, x::Base.OneTo{Int64}, y::Base.OneTo{Int64}, symmetric::Bool)
@ StatsBase C:\Users\sternlab\.julia\packages\StatsBase\pJqvO\src\pairwise.jl:155
[2] pairwise(f::Function, x::Base.OneTo{Int64}, y::Base.OneTo{Int64}; symmetric::Bool, skipmissing::Symbol)
@ StatsBase C:\Users\sternlab\.julia\packages\StatsBase\pJqvO\src\pairwise.jl:288
[3] test(x::Vector{Vector{Float64}})
@ Main .\Untitled-9:3
[4] top-level scope
@ Untitled-9:11
Good catch. This is a very tricky case indeed. #772 fixes this. The fact that inference gives such an imprecise type in the first place could also be improved in HypothesisTests, see JuliaStats/HypothesisTests.jl#263.
Package versions:
(this doesn't happen if the
pairwise
call is in global scope rather than a function)The text was updated successfully, but these errors were encountered: