-
Notifications
You must be signed in to change notification settings - Fork 33
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
Change all priors to use <dist_spec>
#871
Conversation
otherwise they won't work on main
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.
Wow - this is a lot. On the face of it looks good but going to need some time to digest
This is how benchmark results would change (along with a 95% confidence interval in relative change) if deedb9e is merged into main:
|
it won't work anyway as the R code has changed too much
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 333de46 is merged into main:
|
One thing to note is that the lengthscale prior is currently not included in this, because of the extra logic in
It might be worth deciding on a single shape of the prior and then this could also be specified as a <dist_spec> (though this currently doesn't support specifying a minimum, which would either have to be dropped or functionality added).
|
Related to that merging this would enable a more comprehensive exploration of parameter choices and identifiability than what's done in #855 (not requiring editing the stan model) as we can fix parameters and/or try out different distributions with different parameters. |
I think we would need to add this as from memory it really isn't identifiable without setting some bounds |
To be explored in more detail in a future PR then as adding capability to specify a lower bound would require quite substantial changes. |
I've got thursday pencilled in to go through this in detail |
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.
This is great I think. I was a bit sceptical as I thought it would make the models hard to follow but tbh if anything its the versus due to the reduction in control code.
I noted that the Rt prior is treated a little differently and had a few comments on that. At a high level I am happy with it as is and even think its good moving to a normal prior where that has happened (its unclear how intentional that was but I am okay with it).
I don't see any major issues. It looks like it should be relatively easy to support user set lower bounds (and hence also transition over the GP stuff. I noted it would be nice to give users an R helper so they can find the posterior for parameters they are setting but I think this can be a future issue.
I see the stan benchmarks are failing but otherwise LGTM
Note I updated the vignettes in order to look at the git diff. All looks good to me. Happy to revert or keep this as the update.
Wow I have caused a lot of conflicts |
Co-authored-by: Sam Abbott <[email protected]>
Sorry for the confusion on My reasoning was: so far we asked users for the mean and SD of a lognormal distribution which we had as logR ~ normal. In the new set up we could still ask for a prior on log R but that seems unnatural if people might want different distributions. Instead I changed the prior to be a prior on R and then defaulting to lognormal with the same mean and SD as before. If I'm not mistaken this should be no change to before. Where it is normal (in the vignettes?) this was by accident and should be LogNormal. |
Might be easiest to just reset and then run the action post merging |
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've reverted the vignette updating (in a lazy way but will get squashed out) and am happy for this to be merged either with or without the updated Rt priors in the vignettes and examples.
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 7814bdf is merged into main:
|
I've reset the cmdstan actions cache to check if that is the issue (really need to get around to setting up a cache timer in the install cmdstan action). |
I've switched all priors to LogNormal now. Just needs someone to re-approve. |
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 617ed24 is merged into main:
|
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
Description
This PR closes #525 by changing all parameters to use the new interface.
In doing so and in order to keep this manageable the internals of handling parameters had to be updated a fair bit. This is now done similarly to delays in parameter arrays rather than named parameters. In principle this should make it easier to extend the model later with more parameters / probability distributions / time-varying parameters etc.
Things that could be added later fairly easy if deemed useful:
From tests it seems functionality has been preserved but it would be good for people to check if this is actually an improvement.
One thing to note is that now all parameters are initialised from (truncated) standard normal distributions so will have to monitor if this leads to any issues.
Initial submission checklist
devtools::test()
anddevtools::check()
).devtools::document()
).lintr::lint_package()
).After the initial Pull Request