-
Notifications
You must be signed in to change notification settings - Fork 3
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
Recasts to a non-linear model #42
Conversation
I went a bit extra (closing the stable door after the horse has bolted) and extended this to include the proportion SGTF as a latent variable (learning some interesting Code:
Model:
Output (no covariates and winter 2020 data):
One of the cool things with this approach is you can prototype using the point estimates and then set them to NA in your data and model their uncertainty for the final model. Same fit without uncertainty (and 10% of the runtime):
|
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.
LGTM (self review)
This PR recasts as a non-linear model and adds uncertainty for Rt by assuming they are normally distributed. Not sure this is strictly better than what was there previously but interesting perhaps as there is lots of scope for using this for other problems (i.e this is close to a Rt model implemented on top of
brms
). I also looked at adding uncertainty on sgft proportion using a dummy stanadard error but this caused some fairly major fittings issues (maybe could do this using a seperate equation to fit to sgft positive tests).Noticed the
normalize
argument which is new to stan 2.2.5 and allows dropping constants (i.e what I think using the ~ approach does)..devcontainer
stuff is the automated docker stuff from vscode I am trying out but if this is being merged can be gitignored.Not entirely clearl if this branch is up to date and or what the most recent data is so model fit is largely for show.
Model formula
Generated stan:
Basic fit with no predictors: