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

Add MESMER-M example for multiple scenarios and members #572

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

veni-vidi-vici-dormivi
Copy link
Collaborator

What the title says

  • Tests added
  • Fully documented, including CHANGELOG.rst

@veni-vidi-vici-dormivi
Copy link
Collaborator Author

veni-vidi-vici-dormivi commented Dec 3, 2024

What I do here:

  • parameters for the harmonic model are fit for each member and scenario separately and averaged afterwards. This is like for the AR parameters and it makes sense as the order of the samples needs to be conserved
  • for the power transformer I did the same even though I think that stacking the samples would make more sense in this case as only the pairs (yearly_pred, monthly_target) need to be conserved, as for the linear regression
  • autoregression and covariance is the same as for MESMER including weighting samples for the covariance by number of members

Stacking is kind of complicated because I group the data by month in the power transformer and the covariance module and I can do that if we do not fit along a time but a sample dimension.

Note that all parameters are weighted by the number of members (but not by the number of time steps).

Copy link

codecov bot commented Dec 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.48%. Comparing base (1481de9) to head (f8d512a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #572      +/-   ##
==========================================
+ Coverage   78.18%   78.48%   +0.29%     
==========================================
  Files          49       49              
  Lines        3021     3016       -5     
==========================================
+ Hits         2362     2367       +5     
+ Misses        659      649      -10     
Flag Coverage Δ
unittests 78.48% <100.00%> (+0.29%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@veni-vidi-vici-dormivi
Copy link
Collaborator Author

veni-vidi-vici-dormivi commented Dec 4, 2024

@yquilcaille this is usable, with the caveats mentioned above. But as I said, it is dirty and slow. Note that you also need to pull this branch as I made breaking changes (that do not influence the output but the structure of some functions).

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

Successfully merging this pull request may close these issues.

1 participant