-
Notifications
You must be signed in to change notification settings - Fork 4
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
Issue 176: Add support for multiple observation models #249
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #249 +/- ##
==========================================
+ Coverage 92.97% 93.34% +0.37%
==========================================
Files 43 44 +1
Lines 413 436 +23
==========================================
+ Hits 384 407 +23
Misses 29 29 ☔ View full report in Codecov by Sentry. |
Implementing this has also made me thing about hierarchical priors. Currently the only way I can think we might do this is similar to this stacking approach but passing in uninstantiated structs and a prior model function and then in the method instantiating the structs using the prior model. This feels a bit clunky? As far as I am aware we don't have an issue for this so shall we split out and discuss? A good test case for this feels like it might be trying to fit to counts and deaths with a partially pooled overdispersion parameter. Another sensible toy could be trying to fit to cases and deaths with both having 3 age groups (and pooling by dataset and age group both nested and independently). Another option might be allowing structs to be partially instantiated but that feels very bug prone |
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 like this! This is really neat.
This PR closes #176 by adding a new
StackObservationModels
which supports arbitary stacks of observation models with both 1 to 1 and 1 to many infection -> obs mappings.Note that this does not support the passing of unnamed
y_t
in the generated quantities (in the sense of it making no effort to track these) as long term this doesn't seem sustainable - especially due to the lack of integration withprefix
.This implies we are expecting posterior predictions to be done on data using the
y_t
(with prefix) sampled at the lowest level of the stack.if we did want to keep more in the returns this we would need manually prefix I think. To me this suggests a package wide rethink of the use of
return
is needed.