[Scipy-tickets] [SciPy] #1802: Infinite time taken by scipy hypergeom function for some particular values
SciPy Trac
scipy-tickets@scipy....
Thu Jan 3 09:09:55 CST 2013
#1802: Infinite time taken by scipy hypergeom function for some particular values
-------------------------+--------------------------------------------------
Reporter: imsc | Owner: somebody
Type: defect | Status: needs_review
Priority: normal | Milestone: Unscheduled
Component: scipy.stats | Version: 0.11.0
Keywords: |
-------------------------+--------------------------------------------------
Comment(by josefpktd):
Thanks for checking.
I haven't looked at the bisection code in _drv2_ppfsingle since I got it
to work several years ago, and then I didn't understand it very well.
That code has no stopping criterion for the degenerate case when .a == .b,
which couldn't occur before because invcdf_a and invcdf_b where not set
accurately.
my guess is that we can change ```if b == a+1``` to ```if b <= a+1``` to
prevent endless loops when a == b. (it works for this example)
{{{
>>> stats.hypergeom.ppf(0.02, 100, 100, 8)
8.0
>>> stats.hypergeom.ppf(0.02, 32335, 32335, 895)
895.0
}}}
--
Ticket URL: <http://projects.scipy.org/scipy/ticket/1802#comment:7>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.
More information about the Scipy-tickets
mailing list