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

Percentile is not calculated correctly #2

Closed
placeybordeaux opened this issue May 19, 2015 · 4 comments
Closed

Percentile is not calculated correctly #2

placeybordeaux opened this issue May 19, 2015 · 4 comments

Comments

@placeybordeaux
Copy link

The percentile funciton does neither the The Nearest Rank method nor The Weighted Percentile method nor the NIST method all defined here: http://en.wikipedia.org/wiki/Percentile

Which is the prefered method? I was thinking about fixing this myself, which would you prefer?

@montanaflynn
Copy link
Owner

Thanks for bringing this to my attention, I probably found some random answer on stack overflow. They all would be nice to have but Nearest Rank would be a great step forward. I'd also be interested to see the differences between algorithms in practice or at least a nice test suite.

@placeybordeaux
Copy link
Author

I am pretty sure I was able to get an array out of bounds panic with the current code, it's been almost a month though, so I don't want to say for sure.

I generally expect Nearest Rank, but it really depends, both methods are fairly simple, might be worth it to include both.

@montanaflynn
Copy link
Owner

I've added error handling which should prevent any panics but if it happens again please create an issue with the log and how it happened. I think starting with Nearest Rank is a good choice. After looking into it there seem to be quite a lot of definitions so I wouldn't say the percentile function is "not calculated correctly" but just a very rudimentary implementation. Anyways I'm looking forward to a PR.

@montanaflynn
Copy link
Owner

Added the Nearest Rank method of calculating percentiles with commit 8082734, I left the original implementation as it does have it's upsides and will probably be adding the NIST method as well.

Feel free to add any other methods as you see fit, I'm more then open to a pull request!

montanaflynn pushed a commit that referenced this issue Dec 8, 2015
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

No branches or pull requests

2 participants