[Scipy-tickets] [SciPy] #1842: wrong value returned by scipy.stats.binom probability mass function when true probability is 1
SciPy Trac
scipy-tickets@scipy....
Mon Feb 11 18:31:12 CST 2013
#1842: wrong value returned by scipy.stats.binom probability mass function when
true probability is 1
-------------------------+--------------------------------------------------
Reporter: leflage | Owner: rgommers
Type: defect | Status: new
Priority: normal | Milestone: Unscheduled
Component: scipy.stats | Version: 0.11.0
Keywords: |
-------------------------+--------------------------------------------------
Comment(by josefpktd):
Thanks for reporting,
The distributions still have problems with 0 * log(0) at several places,
and they are not always easy to find.
We still don't have a general solution, so it needs to be special cased.
The ``if`` doesn't work, however, because the function needs to work for
vector/array arguments.
I think we use a mask in other places, like
mask = ((p == 1) & (k == n)) | ((p == 0) & (k == 1))
and then conditionally assign.
(It's nicer than using np.where because it avoids the calculation that
raises a warning.)
Do you want to volunteer for a pull request?
--
Ticket URL: <http://projects.scipy.org/scipy/ticket/1842#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