Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

too many critical values returned in documentation examples #11140

Closed
sam-data-guy opened this issue Nov 28, 2019 · 2 comments
Closed

too many critical values returned in documentation examples #11140

sam-data-guy opened this issue Nov 28, 2019 · 2 comments
Labels
Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org scipy.stats

Comments

@sam-data-guy
Copy link

This relates to documentation of the following function: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.anderson_ksamp.html (may apply to other similar functions). The "critical_values" returned attribute should only contain 5 values. Indeed this is how the function works. In the documented examples, however, seven critical values are printed. Is this from an older version of the function? May need to be corrected elsewhere as well.

@rlucas7 rlucas7 added Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org scipy.stats labels Dec 29, 2019
@jmmanley
Copy link
Contributor

Which version of scipy are you using? (You can check by running scipy.__version__).

The docs are for v1.4.1. The 0.1% and 0.5% critical values were added in #8990, and I updated the docs in #10301. So you are probably just using an older version of scipy.

The source code here shows how the 7 critical values are calculated:

scipy/scipy/stats/morestats.py

Lines 2051 to 2054 in eab70a8

b0 = np.array([0.675, 1.281, 1.645, 1.96, 2.326, 2.573, 3.085])
b1 = np.array([-0.245, 0.25, 0.678, 1.149, 1.822, 2.364, 3.615])
b2 = np.array([-0.105, -0.305, -0.362, -0.391, -0.396, -0.345, -0.154])
critical = b0 + b1 / math.sqrt(m) + b2 / m

@mdhaber
Copy link
Contributor

mdhaber commented Nov 25, 2020

Thanks @jmmanley. I confirmed that the function returns 7 critical values in recent SciPy, so the documentation seems correct. @sam-data-guy thanks for looking out for this sort of thing. If you notice anything else, please let us know.

@mdhaber mdhaber closed this as completed Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org scipy.stats
Projects
None yet
Development

No branches or pull requests

4 participants