scipy: ks_2samp: example description does not match example output
The 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
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (12 by maintainers)
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.