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

SciPy Trac scipy-tickets@scipy....
Sat Aug 18 06:43:27 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:  devel      
 Keywords:  hypergeom negative probability  |  
--------------------------------------------+-------------------------------
Changes (by rgommers):

  * version:  0.10.0 => devel


Comment:

 Still an issue in current master. Hypergeom recently got a {{{_sf}}}
 method with higher precision, but needs a {{{_cdf}}} or {{{_logcdf}}}
 method too.

 Note that what you want is actually the survival function, which is way
 faster and gives correct results:
 {{{
 In [11]: hypergeom.sf(30,13397950,4363,12390)
 Out[11]: 1.329942944239457e-17

 In [12]: hypergeom.sf(20,13397950,4363,9260)
 Out[12]: 1.2289025689799385e-11
 }}}

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


More information about the Scipy-tickets mailing list