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

Quantile[Range[16], 1/4] wrong result? #1540

Closed
axkr opened this issue Aug 10, 2021 · 2 comments · Fixed by #1541
Closed

Quantile[Range[16], 1/4] wrong result? #1540

axkr opened this issue Aug 10, 2021 · 2 comments · Fixed by #1541

Comments

@axkr
Copy link

axkr commented Aug 10, 2021

Example in Quantile doc:

Quantile[Range[16], 1/4]

returns 5 should be 4 in Docker container.

@rocky
Copy link
Member

rocky commented Aug 10, 2021

This is hand-hacked code. I'd like to replace it with numpy's or scipy's version. However for numpy

import numpy
>>> numpy.quantile(range(1, 17), 1/4)
4.75
>>> import scipy.stats.mstats
scipy.stats.mstats.mquantiles(range(1,17), 1/4)
array([4.45])

@rocky
Copy link
Member

rocky commented Aug 10, 2021

The Details section in https://reference.wolfram.com/language/ref/Quantile.html provides details and rules for how to do.

rocky added a commit that referenced this issue Aug 10, 2021
Maybe the default was different in an older version of Mathematica?
Fixes #1540
rocky added a commit that referenced this issue Aug 10, 2021
Maybe the default was different in an older version of Mathematica?
Fixes #1540
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants