[Scipy-tickets] [SciPy] #1639: stats.rice.pdf(x, 0) returns nan

SciPy Trac scipy-tickets@scipy....
Wed Apr 4 16:42:41 CDT 2012


#1639: stats.rice.pdf(x, 0) returns nan
------------------------------+---------------------------------------------
 Reporter:  warren.weckesser  |       Owner:  somebody   
     Type:  defect            |      Status:  new        
 Priority:  normal            |   Milestone:  Unscheduled
Component:  scipy.stats       |     Version:  0.10.0     
 Keywords:                    |  
------------------------------+---------------------------------------------

Comment(by josefpktd):

 I think the solution is to overwrite the default argcheck

 something like the following
 (but I didn't check yet which args _argcheck is supposed to have)

 {{{
 >>> def _argcheck(self, *args): return args >=0
 ...
 >>> stats.rice._argcheck = _argcheck
 >>> stats.rice.pdf(np.linspace(0,4,11),0.)
 }}}

 The default has >0

 {{{
     def _argcheck(self, *args):
         # Default check for correct values on args and keywords.
         # Returns condition array of 1's where arguments are correct and
         #  0's where they are not.
         cond = 1
         for arg in args:
             cond = logical_and(cond,(arr(arg) > 0))
         return cond
 }}}

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