-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Improve accuracy of kde() invcdf estimates #124637
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
Conversation
|
For the has maximum error @rhettinger If you are interested I can make the optimization code available and also optimize the other inverse cdf. Besides these optimization considerations the PR looks good to me. |
|
Thanks for putting some work into this. I'm going stick with the PR version though. In addition to tamping down the maximum error, we also want to keep down the mean absolute deviation and standard deviation. Other ideals include being exact and continuous at 0.0, 0.5, and 1.0 and never returning a value outside of |
|
FWIW, this is the extra evaluation code I used: Here are the results for the baseline, pr, and optimized variants: |

KDE's quartic kernel and triweight kernels employ the Newton-Raphson method to compute their inverse-cdf functions. For a starting point, they need a reasonably good estimate of the inverse function. This PR improves those estimates giving both a lower maximum error and lower mean absolute deviation.
Measurement tooling: