[Scipy-tickets] [SciPy] #1803: improve discrete rv ppf isf

SciPy Trac scipy-tickets@scipy....
Tue Jan 1 10:19:58 CST 2013


#1803: improve discrete rv ppf isf
-------------------------+--------------------------------------------------
 Reporter:  josefpktd    |       Owner:  rgommers   
     Type:  defect       |      Status:  new        
 Priority:  normal       |   Milestone:  Unscheduled
Component:  scipy.stats  |     Version:  0.11.0     
 Keywords:               |  
-------------------------+--------------------------------------------------

Comment(by josefpktd):

 two changes, and the problem of ticket:1802 goes away

 {{{
 >>> sd.hypergeom.interval(.945, 187601, 43192, 757)
 (152.0, 197.0)
 >>> sd.hypergeom.interval(.95, 187601, 43192, 757)
 (152.0, 197.0)
 }}}

 don't use self.invcdf_a and _b
 {{{
 def _drv2_ppfsingle(self, q, *args):  # Use basic bisection algorithm
     b = self.b
     a = self.a
 }}}

 and in ``hypergeom._argcheck(self, M, n, N)`` prevent self.a to be
 negative:

 {{{
         self.a = max(N-(M-n), 0)
 }}}

 (Note: I made the changes in my installed 0.11rc2, since I'm not
 rebuilding scipy.)

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1803#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