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

Piecewise linear quantiles #134

Merged
merged 6 commits into from
Jan 13, 2023
Merged

Piecewise linear quantiles #134

merged 6 commits into from
Jan 13, 2023

Conversation

drewoldag
Copy link
Collaborator

This PR is a byproduct of taking on qp issue #8. As a result of the exploration, there is a minor code change included in this PR to introduce an x offset in the locations used when return PDF values for a quant_gen object.

Visually, this offset makes the qp approximation of a PDF and the original PDF align better. Mathematically, it's a byproduct using a forward difference to calculate the numerical derivative. (the need for the offset could be eliminated if we used a central difference, such as that provided by numpy.gradient)

This PR does not address the concerns brought up in qp issue #65. I have an approach that does address this called out in a comment in #8 but I would like to review that as a PR separate from this one.

…PDF location offset in `quant_gen._compute_derivs` to account for the forward difference calculation of numerical derivatives.
@drewoldag
Copy link
Collaborator Author

For some screenshot comparisons of with and w/o the x offset in PDF, see this comment in #8.

@codecov
Copy link

codecov bot commented Dec 22, 2022

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (2aab7de) compared to base (2bdf80a).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #134   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           25        25           
  Lines         2049      2047    -2     
=========================================
- Hits          2049      2047    -2     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/qp/quant_pdf.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@drewoldag drewoldag linked an issue Dec 22, 2022 that may be closed by this pull request
Copy link
Collaborator

@eacharles eacharles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Drew.

@drewoldag drewoldag merged commit 0a5d77d into main Jan 13, 2023
@eacharles eacharles deleted the issue/8/awo-pw-linear-quantiles branch April 12, 2023 16:49
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 this pull request may close these issues.

Piecewise non-constant quantile implementation
2 participants