[Scipy-tickets] [SciPy] #1806: extending distributions, hypergeom, to degenerate cases

SciPy Trac scipy-tickets@scipy....
Thu Jan 3 12:33:04 CST 2013


#1806: extending distributions, hypergeom, to degenerate cases
-------------------------+--------------------------------------------------
 Reporter:  josefpktd    |       Owner:  rgommers   
     Type:  defect       |      Status:  new        
 Priority:  normal       |   Milestone:  Unscheduled
Component:  scipy.stats  |     Version:  0.11.0     
 Keywords:               |  
-------------------------+--------------------------------------------------
 found while looking at ticket:1802

 For hypergeom the case where we only have type I balls works (except for
 numerical precision)

 {{{
 >>> stats.hypergeom.pmf(8, 100, 100, 8)
 1.0000000000000231
 >>> stats.hypergeom.cdf(8, 100, 100, 8)
 1.0
 }}}

 The other degenerate case with zero type I balls is ruled out

 {{{
 >>> spd.hypergeom.cdf(0, 32335, 0, 895)  #ok
 1.0
 >>> spd.hypergeom.pmf(0, 32335, 0, 895)
 nan
 >>> spd.hypergeom.pmf(1, 32335, 0, 895)
 nan
 >>> spd.hypergeom.cdf(-1, 32335, 0, 895)
 nan
 >>> spd.hypergeom.pmf(-1, 32335, 0, 895)
 nan
 >>> spd.hypergeom.ppf(0.02, 32335, 0, 895)
 nan
 >>> spd.hypergeom.ppf(0.0, 32335, 0, 895)
 -1.0
 >>> spd.hypergeom.ppf(1.0, 32335, 0, 895)
 nan
 >>> spd.hypergeom.a
 0
 >>> spd.hypergeom.b
 array(0)
 }}}

 The reason is that ```rv_discrete._argcheck(self,M,n,N)``` requires that
 all arguments are strictly positive

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


More information about the Scipy-tickets mailing list