[Scipy-tickets] [SciPy] #1471: stats.lognorm.pdf(0, s) reports nan

SciPy Trac scipy-tickets@scipy....
Sat Jul 2 21:09:55 CDT 2011

#1471: stats.lognorm.pdf(0,s) reports nan
 Reporter:  jaredd       |       Owner:  somebody   
     Type:  defect       |      Status:  new        
 Priority:  normal       |   Milestone:  Unscheduled
Component:  scipy.stats  |     Version:  0.9.0      
 Keywords:               |  

Comment(by josefpktd):

 The pdf calculates 0/0 if x=0, so a correct value would need to be added
 with a np.where.
 (A disadvantage is that it makes the function longer by an additional
 check for a zero probability event.)

 The calculation might also be better done through logpdf and

 In general there are no systematic tests for boundary behavior and corner
 cases. I guess for pdf we should be able to get rid of any problems. But
 for cdf with numerical integration there can be problems with
 singularities (e.g. rdist.cdf at close to -1) or generic ppf is only
 designed for quantiles away from the boundaries 0 and 1.
 Also, I find it impractical to cover every corner case which might never
 show up in any application, using lots of special, corner case specific

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