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
Update the time shift Ruptures function with the new logic that was tested/validated at PVRW 2023 #197
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable to me! A couple minor comments.
changepoint detection. All data below this threshold is not considered | ||
when determining the mean value for the segment, which is later | ||
rounded to the nearest `period_min` value | ||
top_quantile_threshold : float, default 0.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious... these default values exclude the top 50% of values within each segment, right? I'm surprised that such an symmetrical window is a good default choice. What's the reasoning for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kandersolar this was experimentally derived, and meant to filter out noise. The original code did a 2/3rd cutoff to make the code more conservative about time shifts (we only want to suggest a shift if we're absolutely certain, and we want to error on the side of caution). Essentially this parameter allows the user to decide how cautious they want to be when estimating time shifts.
This update makes the changes to the original function so it now matches the finalized logic that I used for validation in the PVRW 2023 poster (https://www.nrel.gov/docs/fy23osti/85699.pdf). Most notably, we use binary segmentation instead of Pelt here, which results in a massive speedup while still being performant.
docs/api.rst
.in
docs/whatsnew
for all changes. Includes link to the GitHub Issue with
:issue:`num`
or this Pull Request with
:pull:`num`
. Includes contributor nameand/or GitHub username (link with
:ghuser:`user`
).