[Scipy-tickets] [SciPy] #540: scipy.stats.distributions.norm.cdf returns nan

SciPy scipy-tickets@scipy....
Fri Nov 16 21:11:02 CST 2007

#540: scipy.stats.distributions.norm.cdf returns nan
 Reporter:  emv          |       Owner:  somebody
     Type:  defect       |      Status:  new     
 Priority:  normal       |   Milestone:  0.7     
Component:  scipy.stats  |     Version:          
 Severity:  normal       |    Keywords:          
 Very strange: norm.cdf returns nan for no particular reason, and with no
 visible pattern. Some particular combinations of parameters cause this to
 happen. These combinations are also rare. Example:

 In [3]: x, l, s = (1.38629436112, 0.950273420309, 0.204423758009)

 In [4]: from scipy.stats.distributions import *

 In [5]: norm.cdf(x, loc=l, scale=s)
 Out[5]: array(nan)

 BUT changing the values even slightly causes the problem to disappear.

 In [6]: norm.cdf(x, loc=l, scale=s-.01)
 Out[6]: array(0.98753972245290123)

 In [7]: norm.cdf(x, loc=l, scale=s+.01)
 Out[7]: array(0.97899668351739855)

 In [10]: norm.cdf(x-.5, loc=l, scale=s)
 Out[10]: array(0.3771506947259281)

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

More information about the Scipy-tickets mailing list