[Scipy-tickets] [SciPy] #1614: logcdf function of normal distribution (scipy.stats) can not handle a wide enough range of values
SciPy Trac
scipy-tickets@scipy....
Sun Apr 1 14:55:25 CDT 2012
#1614: logcdf function of normal distribution (scipy.stats) can not handle a wide
enough range of values
-------------------------------------+--------------------------------------
Reporter: andrewschein | Owner: somebody
Type: defect | Status: needs_review
Priority: normal | Milestone: 0.11.0
Component: scipy.stats | Version: devel
Keywords: normal distribution cdf |
-------------------------------------+--------------------------------------
Comment(by rgommers):
Hi Andrew, the rest of the review by @pv was on the PR linked above. We
checked the discontinuity around -10, and it's visible in a plot. The
discontinuity there is about 1e-2, compared to the function value of -50.
{{{
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
norm = stats.norm()
x = np.linspace(-9.9, -10.1, 300)
y = norm.logcdf(x)
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(x, y, 'b-')
plt.show()
print 'Discontinuity around -10: ', norm.logcdf(-10+1e-10) -
norm.logcdf(-10-1e-10)
}}}
Maybe you can also comment about why you chose to use the approximation
for a < -10 only.
--
Ticket URL: <http://projects.scipy.org/scipy/ticket/1614#comment:14>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.
More information about the Scipy-tickets
mailing list