-
Notifications
You must be signed in to change notification settings - Fork 41
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
add signrank distribution #173
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #173 +/- ##
==========================================
- Coverage 62.99% 57.97% -5.03%
==========================================
Files 14 15 +1
Lines 635 690 +55
==========================================
Hits 400 400
- Misses 235 290 +55 ☔ View full report in Codecov by Sentry. |
I'd try to add it to test/rmath.jl` similarly to Lines 233 to 241 in 8f50565
|
e63bf83
to
fb4cedc
Compare
Some differences with R remain: julia> signrankinvcdf(4, 0.0)
0.0
julia> signrankinvlogcdf(4, log(0))
0.0
julia> qsignrank.(0.0,4,true,false)
0.0
julia> qsignrank.(log(0.0),4,true,true)
NaN Rounding in the quantiles is also an issue: julia> qsignrank.(-2.1,4,true,true)
1.0
julia> qsignrank.(-2.0794415416798357,4,true,true)
1.0
julia> qsignrank.(-2.0,4,true,true)
2.0
julia> signrankinvlogcdf(4,-2.1)
1.0
julia> signrankinvlogcdf(4,-2.0794415416798357)
2.0
julia> signrankinvlogcdf(4,-2.0)
2.0 The true cdf jumps at 0.125, but that value does not roundtrip with exp/log. julia> exp(-2.0794415416798357)
0.12500000000000003
julia> log(0.125)
-2.0794415416798357
julia> exp(log(0.125))
0.12500000000000003 |
I improved rounding by getting rid of all |
end | ||
|
||
function signrankinvlogccdf(n::Int, logp::Float64) | ||
signrankinvlogcdf(n, log1mexp(logp)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that you might be able to match for this one if you instead of relying on log1mexp
then do a search similarly to signrankinvlogcdf
.
Implementation of the signrank distribution.
The
cdf
is heavily optimized, since that is what is needed for the popular hypothesis test associated with this distribution.The testing in this package seems quite involved, I could use some pointers on where to add the tests.