Anybody to confirm a result in scipy.stats.distributions
All, Could anybody in/confirm the following result ? (scipy 0.8.0.dev5845),
import scipy.stats.distributions as dist dist.gamma(4.).cdf(dist.gamma(4.).ppf(0.25)) 0.0
I would have expected 0.25, of course. The pb seems to be
dist.gamma(4.).ppf(0.25) 0.0 when R gives 2.53532
Thx in advance for any help/comments P.
On Tue, Jul 14, 2009 at 21:51, Pierre GM<pgmdevlist@gmail.com> wrote:
All, Could anybody in/confirm the following result ? (scipy 0.8.0.dev5845),
>>> import scipy.stats.distributions as dist >>> dist.gamma(4.).cdf(dist.gamma(4.).ppf(0.25)) 0.0
I can confirm the bug. special.gammaincinv(x,y) appears to not like y=0.25 for any x, but any other y seems to be fine. These are suggestive lines in c_misc/gammaincinv.c: if (a <= 0.0 || y <= 0.0 || y > 0.25) { return cephes_igami(a, 1-y); } double flo = -y, fhi = 0.25 - y; -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
On Jul 14, 2009, at 11:06 PM, Robert Kern wrote:
On Tue, Jul 14, 2009 at 21:51, Pierre GM<pgmdevlist@gmail.com> wrote:
All, Could anybody in/confirm the following result ? (scipy 0.8.0.dev5845),
import scipy.stats.distributions as dist dist.gamma(4.).cdf(dist.gamma(4.).ppf(0.25)) 0.0
I can confirm the bug. special.gammaincinv(x,y) appears to not like y=0.25 for any x, but any other y seems to be fine.
Excellent (well, quite the opposite, but at least it doesn't come from me). I created ticket #975. Robert, thanks a lot for confirming. Meanwhile, I gonna work with 0.2500001 instead of 0.25. P.
participants (2)
-
Pierre GM
-
Robert Kern