-
-
Notifications
You must be signed in to change notification settings - Fork 23.1k
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
Corrected rank normal distribution #817
Corrected rank normal distribution #817
Conversation
Uses Math.js for erf function
@magneticflux- is attempting to deploy a commit to the github readme stats Team on Vercel. A member of the Team first needs to authorize it. |
Codecov Report
@@ Coverage Diff @@
## master #817 +/- ##
==========================================
- Coverage 93.94% 93.88% -0.07%
==========================================
Files 22 22
Lines 677 670 -7
Branches 188 187 -1
==========================================
- Hits 636 629 -7
Misses 37 37
Partials 4 4
Continue to review full report at Codecov.
|
Thanks for working on this @magneticflux- Can you show/add more examples on how this change is effected the ranks? that would be nice too see and for further tweaking the values. |
This PR replaces the approximation of the error function (used to compute the normal CDF) with a more precise approximation that is accurate to at least 18 significant decimal digits over the domain of the function. The details of the new approximation can be found here: https://mathjs.org/docs/reference/functions/erf.html In practical terms, this PR reduces error in calculating the normal CDF. It reduces error near the mean slightly (as seen in the changed test value), but it reduces error at the extremes more. Some examples:
Again, this PR only addresses problem 1 that I bring up in #455. Problem 2, using an ill-suited probability distribution, is still an issue and I intend to open another PR that migrates to a different distribution (using the Math.js library I introduce in this PR). |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
To fix #455 completely, I'd like to log anonymous statistics for requests to the API so that we can create a histogram plot of their score. That would let us calculate a grade based on the average of all |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This does NOT
fix
#455 completely, but it corrects the normal distribution function to something that is known to be correct.In the future, I plan to replace the normal CDF with a power law CDF, which is made easier by migrating the existing normal CDF to a math library right now.