[Scipy-tickets] [SciPy] #1291: stats.discrete distributions hypergeom.sf exception

SciPy Trac scipy-tickets@scipy....
Wed Sep 29 21:57:43 CDT 2010


#1291: stats.discrete distributions hypergeom.sf exception
-------------------------+--------------------------------------------------
 Reporter:  josefpktd    |       Owner:  somebody
     Type:  defect       |      Status:  new     
 Priority:  normal       |   Milestone:  0.9.0   
Component:  scipy.stats  |     Version:  0.7.0   
 Keywords:               |  
-------------------------+--------------------------------------------------

Comment(by josefpktd):

 workaround: call sf with some points in the support of the distribution
 first

 {{{
 >>> import numpy as np
 >>> from scipy import stats
 >>> stats.hypergeom.sf(np.arange(10),10,2,5)
 array([  7.77777778e-01,   2.22222222e-01,  -4.44089210e-16,
          0.00000000e+00,   0.00000000e+00,   0.00000000e+00,
          0.00000000e+00,   0.00000000e+00,   0.00000000e+00,
          0.00000000e+00])
 >>> stats.hypergeom.sf(5,10,2,5)
 0.0
 }}}

 maybe related ticket for precision loss (-4.44089210e-16) ticket:1218

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


More information about the Scipy-tickets mailing list