[SciPy-dev] bug in scipy.stats package

Leon Adams skorpio11@gmail....
Fri Jan 8 10:56:59 CST 2010


Hi all,
I am currently doing some work involving distribution fitting and it looks
like a came across a strange bug in the ppf function of the gamma
distribution. Can some one else verify and if so suggest possible
resolution. Below is a sample of my python script:

import scipy.stats as st
import numpy as np
nbins = 12
binProb = np.zeros(nbins) + 1.0/nbins
binSumProb = np.add.accumulate(binProb)
print binSumProb
print st.gamma.ppf(binSumProb,0.6379,loc=1.6,scale=39.555)

With the following output:
[ 0.08333333  0.16666667  0.25        0.33333333  0.41666667  0.5
  0.58333333  0.66666667  0.75        0.83333333  0.91666667  1.        ]
[  2.28713122   3.68072087   1.6          8.20183111  11.42062087
  15.44977132  20.5371578   27.11627185  36.01838095  49.13633397
  72.58240868          Inf]

The problem occurs at an input value of 0.25, the ppf returns the location
parameter (in this case 1.6)

Thanks in advance
-- 
Leon Adams
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-dev/attachments/20100108/87daeff1/attachment.html 


More information about the SciPy-Dev mailing list