Wrong results with hypergeom cdf
See original GitHub issueThe hypergeometric cdf gives wrong results with invalid parameters
Reproducing code example:
import numpy as np
import scipy.stats as st
print(st.hypergeom(M=3, n=3, N=4).pmf(np.arange(5)))
print(st.hypergeom(M=3, n=3, N=4).cdf(np.arange(5)))
[nan nan nan nan nan]
[nan nan nan 1. 1.]
Scipy/Numpy/Python version information:
scipy = 1.5.4
numpy = 1.19.4
sys.version_info(major=3, minor=8, micro=5, releaselevel='final', serial=0)
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
scipy.stats.hypergeom — SciPy v1.9.3 Manual
As an instance of the rv_discrete class, hypergeom object inherits from it a collection of generic methods (see below for the full list),...
Read more >scipy.stats.hypergeom: Nan - Stack Overflow
1 Answer 1 ... You can't draw 24 objects from a collection whose total size is 6. The PMF is undefined in that...
Read more >Multivariate Hypergeometric Cumulative Distribution Function
There's still a possibility that both of my approaches are wrong, but when two separate methods yield the same results it's promising. I...
Read more >HYPGEOM.DIST function - Microsoft Support
Returns the hypergeometric distribution. HYPGEOM. ... DIST returns the cumulative distribution function; if FALSE, it returns the ... Description (Result).
Read more >hypergeom
rv_null = st.hypergeom(M, n, N) x_null = np.arange(0, 40) pmf_null = rv_null.pmf(x_null) fig, ... Scipy's logcdf function returns non-sensical results:.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I think a separate PR would be better.
@tirthasheshpatel, that doesn’t look right. The same problem occurs with the public method
support:I suspect a call to
_argcheckneeds to be incorporated into thesupportmethod of therv_genericclass.