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
Implement shape parameter calibration for ClimWIP #1905
Conversation
Hey @Peter9192 ! I now have a first running version. If you have time tomorrow at some point we could discuss it. It is quite similar to my pseudo code idea with the addition of the scipy.minimize |
Hey @lukasbrunner I'm on it now. I totally see why you made the utilities file, but it's quite hard to compare the changes now. Do you think you could split up the commits a bit more logically (maybe move everything first without changes, then the actual changes)? That would make it much easier to go commit by commit and evaluate the relevant changes only. |
Ah sorry yes! I always get ahead of myself and then there are no atomic commits any more... but really the changes to climwip.py are limited to moving functions to utilities.py and utilities.py contains only functions from the original climwip.py. So the only real changes are isolated in calibrate_sigmas.py (except for the call in climwip.py and a very small piece cross-checking if sigmas are already set) Do you still want me to redo this? Might be a good learning process for me anyway so that would be okay :) |
Let's discuss it first |
if confident: | ||
return performance_sigma | ||
return 9999 - performance_sigma | ||
|
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.
Apologies for cross posting 😋
Maybe this is still too simple, but I wanted to offer a thought. If we specify confidence
as a spectrum around 0.80, where anything below 0.80 is overconfident (and lower is worse), and anything above 0.80 as 'underconfident' (diffident? ; higher is worse), then minimizing something like abs(confidence - target_confidence)
where target_confidence=0.80
could maybe work?
- calculate_model_distances: update docstring - calculate_model_distances: add argument to name new dimension name - compute_overall_mean: simplify median calculation - combine_ensemble_members: update docstring - combine_ensemble_members: allow passing of dimension names to be combined - calculate_weights: move actualy calculation to a new function to get more flexible. This function becomes a wrapper doing xarray stuff
Hey @Peter9192 !
Example figure sigma calibration
Additional information: I also show a measure of "sharpness", i.e., the ratio between weighted and unweighted spread for each perfect model. The smaller the value the stronger the constraint of the weighting, with sharpness -> 1 for sigma -> infinity. The cost function needs to basic properties: If no confident sigma can be found it needs to pick the largest possible value (weakest weighting) and for all confident values it needs to pick the smallest possible value. |
Since @Peter9192 asked, ESMValBot will run recipe recipe_climwip_test_performance_sigma.yml as soon as possible, output will be generated here |
ESMValBot is sorry to report it failed to run recipe recipe_climwip_test_performance_sigma.yml: exit is 1, output has been generated here |
@ruthlorenz would you have time to do the scientific review this week? If you can try if it runs for you on the ETH resources, then I can stop trying with the bot.. |
yes I can do a scientific review |
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.
I added a few little things that need changing. Otherwise looks good to me and runs fine.
However, I am not completely independent since I run on the same servers as @lukasbrunner.
…Group/ESMValTool into climwip_sigma_calibration
Thanks @ruthlorenz for the careful check!! |
Seems unrelated to the PR, something with the test_cmorize_obs. Guessing this might be due to some of the refactoring of the logger we did recently in the core (@stefsmeets ?). |
I don't know what happened with this, should have been fixed by #2020 |
#2020 fixed it for the current development |
One more minor technical remark @lukasbrunner, can you run yamllint on the changed recipes? I think you might want to trim down the line length on some of the descriptions you've added. |
Thanks! @ESMValGroup/esmvaltool-coreteam |
Could you please merge the master branch into this pull request, so all the tests pass? |
I take it that @ruthlorenz ok-ed this scientologically and @Peter9192 technically right? :grin: I am going to change labels and pending test passing I am going to merge, please object if otherwise :+1: |
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.
All good now
Tasks
yamllint
to check that your YAML files do not contain mistakesModified recipe/diagnostic
doc/sphinx/source/recipes
folderIf you need help with any of the tasks above, please do not hesitate to ask by commenting in the issue or pull request.
Closes #1902
Documentation: https://esmvaltool--1905.org.readthedocs.build/en/1905/recipes/recipe_climwip.html