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

Bug in quantile interpolation #83

Closed
aimalz opened this issue Aug 10, 2017 · 3 comments
Closed

Bug in quantile interpolation #83

aimalz opened this issue Aug 10, 2017 · 3 comments

Comments

@aimalz
Copy link
Owner

aimalz commented Aug 10, 2017

There's a bug in the reconstruction of the PDF from quantiles that's causing them to blow up at the endpoints. I'm going to change the interpolation function for quantiles to require endpoints at which the CDF is 0 and 1 so it doesn't cause nonsensical linear interpolation. This will require changing the syntax for qp.PDF.quantize(). I'm going to use this opportunity to make the syntax more consistent as was suggested in #79.

@aimalz
Copy link
Owner Author

aimalz commented Aug 12, 2017

The bug is resolved and merged into the paper branch via two tricks. The first trick was to choose endpoints such that linear interpolation still satisfied the definition of the quantiles (duh). The second trick was to start the optimizer with a good guess of where the quantiles were by evaluating the CDF and finding the closest places to the desired quantiles. Now quantization is faster and more accurate, an improvement that propagates all the way to the final results!

@aimalz aimalz closed this as completed Aug 12, 2017
@drphilmarshall
Copy link
Collaborator

drphilmarshall commented Aug 13, 2017 via email

@aimalz
Copy link
Owner Author

aimalz commented Aug 15, 2017

This fix doesn't exactly deserve praise. Though it guarantees a solid solution for the quantiles, it still has issues. For example, it broke the nosetests because it takes too long on perverse cases where the first guess of the quantiles is terrible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants