[SciPy-User] gamma ppf weirdness

Art Poon artpoon@gmail....
Wed Nov 25 00:30:46 CST 2009


Hello,

I'm trying to hammer out some quick simulation code and need to calculate a bunch of inverse CDF values from the gamma distribution.  SciPy seems like a great resource for this.  However, I've encountered some strangeness that is probably my own fault:

>>> g = stats.gamma(1,0,1)
>>> g
<scipy.stats.distributions.rv_frozen object at 0x1b9b2b0>
>>> g.ppf(0.1)
0.10536051565782635
>>> g.ppf(0.25)
0.0
>>> g.ppf(0.2500001)
0.28768220578512327
>>> g.ppf(0.2499999)
0.28768193911845646
>>> g.ppf(0.25)
0.0

I'm just dying to know where I've gone wrong here!  In the meantime, I'm coding up a function to compute the inverse CDF from MATLAB code.  

I'm using Snow Leopard with Python 2.5.4 (bypassing default system Python 2.6.1), numpy-1.3.0 and scipy-0.7.1, both compiled from source.  

Thanks!
- Art.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20091124/08b1da9b/attachment.html 


More information about the SciPy-User mailing list