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

make quantreg run with statistical uncertainty #143

Merged
merged 15 commits into from
Mar 28, 2024
Merged

make quantreg run with statistical uncertainty #143

merged 15 commits into from
Mar 28, 2024

Conversation

davidrzhdu
Copy link
Contributor

No description provided.

@kemccusker kemccusker marked this pull request as ready for review January 9, 2024 21:45
Copy link

codecov bot commented Jan 9, 2024

Codecov Report

Attention: Patch coverage is 70.00000% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 65.56%. Comparing base (1231b65) to head (7b3ce13).
Report is 35 commits behind head on main.

❗ Current head 7b3ce13 differs from pull request most recent head f6ec22a. Consider uploading reports for the commit f6ec22a to get more accurate results

Files Patch % Lines
src/dscim/menu/main_recipe.py 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #143      +/-   ##
==========================================
+ Coverage   65.12%   65.56%   +0.44%     
==========================================
  Files          17       17              
  Lines        1832     1838       +6     
==========================================
+ Hits         1193     1205      +12     
+ Misses        639      633       -6     

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

@JMGilbert
Copy link
Contributor

@kemccusker The labor SCCs are now replicating and this PR is ready for review again.

@@ -318,6 +318,8 @@ def scc():
self.logger.info("Processing SCC calculation ...")
if self.fit_type == "quantreg":
self.full_uncertainty_iqr
self.calculate_scc
Copy link
Member

Choose a reason for hiding this comment

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

Not clear to me why we call full_uncertainty_iqr and stat_uncertainty_iqr here. Are we assuming we'll want to calculate both anything we have a "quantreg" fit type? I don't think that's necessarily true.

Copy link
Contributor

Choose a reason for hiding this comment

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

I wasn't sure exactly how to work with this since it's kind of a weird quirk of the order_plate function. In the original scc function which is a "course" of the order_plate function, it will only calculate full_uncertainty_iqr (if quantreg). This meant that if I wanted statistical uncertainty, I couldn't go through the order_plate function. There are a few potential solutions I can think of:

  • Add a new attribute to dscim that specifies uncertainty range (i.e. stat or full)
  • Replace this scc function with a function that calls recipe functions according to which save_files you have specified
  • Replace the two uncertainty functions with a single function that feeds the scc (collapsed for stat uncertainty or uncollapsed for full uncertainty) into it based on fair_aggregation
  • Add a few more "courses" that allow the user to select which type of scc they want

Copy link
Member

Choose a reason for hiding this comment

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

Let's try the first option "Add a new attribute to dscim that specifies uncertainty range (i.e. stat or full)" in a later PR

@save(name="stat_uncertainty_iqr")
def stat_uncertainty_iqr(self):
"""Calculate the distribution of quantile-weighted SCCs produced from
quantile regressions collapsed across pulse dimension.
Copy link
Member

Choose a reason for hiding this comment

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

"collapsed across pulse dimension" is a bit confusing. This IQR is taken across only the quantreg quantile dimension because there is no climate uncertainty dimension. This is trickier with RFF-SPs and we need to test it.

Copy link
Member

Choose a reason for hiding this comment

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

Let's reword "quantile regressions that have already been collapsed across other dimensions to give statistical-only uncertainty".
In a separate PR, we should nicely fail if someone tries to run quantreg with RFF-SPs.

@kemccusker kemccusker merged commit 10afcf5 into main Mar 28, 2024
2 checks passed
@kemccusker kemccusker deleted the labor_scc branch March 28, 2024 19:28
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.

3 participants