ks_2samp: example description does not match example output
See original GitHub issueThe text describing the example no longer matches the output of the code.
https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.ks_2samp.html https://github.com/scipy/scipy/blob/master/scipy/stats/stats.py#L7454
For a slightly different distribution, we cannot reject the null hypothesis at a 10% or lower alpha since the p-value at 0.144 is higher than 10%
rvs3 = stats.norm.rvs(size=n2, loc=0.01, scale=1.0, random_state=rng)
stats.ks_2samp(rvs1, rvs3)
KstestResult(statistic=0.07833333333333334, pvalue=0.4379658456442945)
This is a regression, a much earlier version is correct: https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.stats.ks_2samp.html
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (12 by maintainers)
Top Results From Across the Web
scipy.stats.ks_2samp — SciPy v1.9.3 Manual
Performs the two-sample Kolmogorov-Smirnov test for goodness of fit. This test compares the underlying continuous distributions F(x) and G(x) of two independent ...
Read more >Kolmogorov-Smirnov (ks_2samp) p-value not as expected ...
A difficulty with the Kolmogorov-Smirnov test, used with large sample sizes, is that small, unimportant differences between two samples are ...
Read more >Two-sample Kolmogorov-Smirnov Test in Python Scipy
If the K-S statistic is small or the p-value is high, then we cannot reject the hypothesis that the distributions of the two...
Read more >Kolmogorov-Smirnov 2-Sample Goodness of Fit Test
Purpose: Perform a Kolmogorov-Smirnov two sample test that two data samples come from the same distribution. Note that we are not specifying ...
Read more >result mismatch between sp.stats.mstats.ks_twosamp ... - GitHub
Computes the Kolmogorov-Smirnov test on two samples. Missing values in `x` and/or `y` are discarded.
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
As long as the seeds are large (128 bits), I don’t mind that approach. I’m not too concerned about people literally copy-pasting the examples (so I don’t care to have an explicit warning) so much as seeing every example with tiny seeds. The cumulative effect of every example with
seed=0
orseed=1234
has had a bad effect on production code, I think.The original issue was fixed by gh-15651.