diff --git a/Project.toml b/Project.toml index c136038..3e47622 100644 --- a/Project.toml +++ b/Project.toml @@ -1,13 +1,13 @@ name = "Rmath" uuid = "79098fc4-a85e-5d69-aa6a-4863f24498fa" -version = "0.7.0" +version = "0.7.1" [deps] Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" Rmath_jll = "f50d1b31-88e8-58de-be2c-1cc44531875f" [compat] -Rmath_jll = "0.3" +Rmath_jll = "0.3, 0.4" julia = "1.3" [extras] diff --git a/test/runtests.jl b/test/runtests.jl index 7b0f0d9..9755f59 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -134,10 +134,18 @@ allEq(Rt2, qt.(1 .- Pt2, 1.01, false), 1e-2) allEq(Runif, qunif.(1 .- Punif, .2, 2, false)) allEq(Rweibull, qweibull.(1 .- Pweibull, 3, 2, false)) allEq(Rwilcox, qwilcox.(1 .- Pwilcox, 13, 17, false)) + +const logPbinom = pbinom.(Rbinom, 55, pi/16, true, true) +const logPnbinom = pnbinom.(Rnbinom, 7, .01, true, true) +const logPpois = ppois.(Rpois, 12, true, true) +const logcPbinom = pbinom.(Rbinom, 55, pi/16, false, true) +const logcPnbinom = pnbinom.(Rnbinom, 7, .01, false, true) +const logcPpois = ppois.(Rpois, 12, false, true) + ## Check q*(p* ( log ), log) = identity allEq(Rbeta, qbeta.(log.(Pbeta), .8, 2, true, true)) -allEq(Rbinom, qbinom.(log.(Pbinom), 55, pi/16, true, true)) +allEq(Rbinom, qbinom.(logPbinom, 55, pi/16, true, true)) allEq(Rcauchy, qcauchy.(log.(Pcauchy), 12, 2, true, true)) allEq(Rchisq, qchisq.(log.(Pchisq), 3, true, true), 1e-14) allEq(Rexp, qexp.(log.(Pexp), 2, true, true)) @@ -147,9 +155,9 @@ allEq(Rgeom, qgeom.(log.(Pgeom), pi/16, true, true)) allEq(Rhyper, qhyper.(log.(Phyper), 40, 30, 20, true, true)) allEq(Rlnorm, qlnorm.(log.(Plnorm), -1, 3, true, true)) allEq(Rlogis, qlogis.(log.(Plogis), 12, 2, true, true)) -allEq(Rnbinom, qnbinom.(log.(Pnbinom), 7, .01, true, true)) +allEq(Rnbinom, qnbinom.(logPnbinom, 7, .01, true, true)) allEq(Rnorm, qnorm.(log.(Pnorm), -1, 3, true, true)) -allEq(Rpois, qpois.(log.(Ppois), 12, true, true)) +allEq(Rpois, qpois.(logPpois, 12, true, true)) allEq(Rsignrank, qsignrank.(log.(Psignrank), 47, true, true)) allEq(Rt, qt.(log.(Pt), 11, true, true)) allEq(Rt2, qt.(log.(Pt2), 1.01, true, true), 1e-2) @@ -159,7 +167,7 @@ allEq(Rwilcox, qwilcox.(log.(Pwilcox), 13, 17, true, true)) ## same q*(p* (log) log) with upper tail: allEq(Rbeta, qbeta.(log.(1 .- Pbeta), .8, 2, false, true)) -allEq(Rbinom, qbinom.(log.(1 .- Pbinom), 55, pi/16, false, true)) +allEq(Rbinom, qbinom.(logcPbinom, 55, pi/16, false, true)) allEq(Rcauchy, qcauchy.(log.(1 .- Pcauchy), 12, 2, false, true)) allEq(Rchisq, qchisq.(log.(1 .- Pchisq), 3, false, true)) allEq(Rexp, qexp.(log.(1 .- Pexp), 2, false, true)) @@ -169,9 +177,9 @@ allEq(Rgeom, qgeom.(log.(1 .- Pgeom), pi/16, false, true)) allEq(Rhyper, qhyper.(log.(1 .- Phyper), 40, 30, 20, false, true)) allEq(Rlnorm, qlnorm.(log.(1 .- Plnorm), -1, 3, false, true)) allEq(Rlogis, qlogis.(log.(1 .- Plogis), 12, 2, false, true)) -allEq(Rnbinom, qnbinom.(log.(1 .- Pnbinom), 7, .01, false, true)) +allEq(Rnbinom, qnbinom.(logcPnbinom, 7, .01, false, true)) allEq(Rnorm, qnorm.(log.(1 .- Pnorm), -1, 3, false, true)) -allEq(Rpois, qpois.(log.(1 .- Ppois), 12, false, true)) +allEq(Rpois, qpois.(logcPpois, 12, false, true)) allEq(Rsignrank, qsignrank.(log.(1 .- Psignrank), 47, false, true)) allEq(Rt, qt.(log.(1 .- Pt ), 11, false, true)) allEq(Rt2, qt.(log.(1 .- Pt2), 1.01, false, true), 1e-2)