Repository navigation
Learn from unclipped hours and apply k before the AC clip - #10
Merged
Merged
Conversation
- New opt-in curtailment.clip_limit_kw. Hours where the forecast reaches 70 % of it are left out of learning, so an oversized array's flat tops are not learned as lost yield. The hours are picked on the forecast: dropping hours measured at the limit would keep the ones where the forecast was too high, which pulls g low. Off by default: on a hybrid that charges the battery above its AC rating, an hour at the AC limit is real production. - run() applies k to the unclipped ensemble mean and clips once, so P50 is clip(mean x k) instead of clip(mean(clip)) x k. P10/P25/P90 are scaled from the unclipped expectation. learn() clips its ensemble after the mean, the same way, so the ratios stay on the same footing. Fixes #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5.
Two changes:
curtailment.clip_limit_kw, opt-in. Hours where the forecast reaches 70 % of this limit are left out of learning, so an oversized array's flat tops are no longer learned as lost yield. I first filtered on the measured value (an hour at 97 % of the limit) and dropped it: with hourly forecast error, the hours kept near the limit are the ones where the forecast was too high, and g comes out low. Filtering on the forecast does not have that bias. It stays off by default because on a hybrid that charges the battery above its AC rating, an hour at the AC limit is real production.One change applies to everyone, with or without the option: on hours where the expectation is above the AC limit, P10/P25 now come from the unclipped expectation, so they move up toward the limit. Before, P10 was 0.6 × the limit on an hour that would clip even on a poor day.
Left for later:
Tests: 7 in tests/test_clipping.py. On main, 6 fail; the 7th pins today's behaviour without the option. One of them adds 15 % hourly forecast error: filtering on the measured value gave g = 0.84 for a true 0.90, filtering on the forecast gives 0.90 ± 0.02. The full suite passes on Python 3.11 and 3.12. I have not run it on a real clipping roof: ours never clips (highest hour 11.4 kW, limit 12 kW).