[Scipy-tickets] [SciPy] #1719: Negative p-value on hypergeom.cdf

SciPy Trac scipy-tickets@scipy....
Thu Aug 16 17:33:05 CDT 2012

#1719: Negative p-value on hypergeom.cdf
 Reporter:  lucapinello                     |       Owner:  somebody   
     Type:  defect                          |      Status:  new        
 Priority:  high                            |   Milestone:  Unscheduled
Component:  scipy.stats                     |     Version:  0.10.0     
 Keywords:  hypergeom negative probability  |  
 I have noticed that not only the precision for  hypergeom.cdf is not very
 good but for some cases the value is negative.

 I compared the results with Matlab and R.

 Two simple examples:

 1) Negative values:
 from scipy.stats import hypergeom
 >>> 1-hypergeom.cdf(30,13397950,4363,12390)


 In both Matlab and R you obtain 0.

 2) Bad precision:
 >>> 1-hypergeom.cdf(20,13397950,4363,9260)


 In both Matlab and R you obtain 1.228906e-11

 Thanks for this great project, I hope you can fix this bug soon.


 Luca Pinello

Ticket URL: <http://projects.scipy.org/scipy/ticket/1719>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.

More information about the Scipy-tickets mailing list