-
Notifications
You must be signed in to change notification settings - Fork 32
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
GP prior for growth rate #211
Conversation
I am a bit lost in the changes here but I thought I had already nearly done this by placing a prior on (
Just looking at the branch. Looked at the branch and I see more what your getting at now. I think it makes sense and is worth exploring. When I looked at the model above I was quite surprised there wasn't more speed up as it seems like there really should be. My plan (#206) was to generalise |
The way I thought about this is that all the models have the same relationship between I, Rt and r: where the models differ only in the choices of GP prior and where it applies (in very simple terms, what is being smoothed) - available models being (where C is the number of cases and me the mean shift):
to which I thought it would make sense to add (in order to avoid calculations with / dependency on the generation time):
What I hadn't realised is that model (3) was already implemented - which is indeed very similar to (6), differences being the centering of the prior around r0 based on given R0 prior, exponentiation of the GP and availability of break points (which are trickier to interpret than with R i think). Completely agree that adding covariates would be a great extension (in a flexible way, i.e. including arbitrary/nonlinear interactions as in brms), and that backcalculation and generating infectiousness are really the same model (given by the equations above + observation model) so it should be possible to streamline/simplify. |
Yes totally agree. Really nice to have the model family written down. The other extension would be to add more links. An obvious one being the logit (so that R0 has an upper bound). I was thinking of doing this in two stages.
|
Great - only thought re 2 is that it would be nice if an arbitrary relationship could be used / passed in (e.g. as Stan code) as with the S gene dropout analysis using |
The issue with that is you would need to recompile the model (as in brms) rather than supply it compiled. I agree would be nice though. Could maybe set it up to work as compiled and optionally add other options you can only use if you recompile. I was also thinking you could just focus on the custom model family and therefore have something that reproduced much of what EpiNow2 does but as a plug in for brms. |
I had a look at whether a model with a GP prior on the growth rate (instead of R) would perform better (in particular: easier/faster to fit as it avoids calculations around the generation time).
It seems to work but no discernible improvement in sampling - not sure if worth keeping: