-
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
move lengthscale prior to dist_spec
#890
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
The vignettes show no meaningful change in results or number of divergent transitions. Benchmarks also show no significant change in performance. If this looks correct to people we can probably merge and explore further building on this. |
This comment was marked as outdated.
This comment was marked as outdated.
@seabbs Do you want to take this one? |
Testing this on a few data sets I encountered no issues but an eye would have to be kept on this in the near future. |
@sbfnk can you plot the change in the prior here if you get a chance? |
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.
From a technical stand point I think this is correct.
From a scientific standpoint I have a lot of reservations about:
- How do people reason on this prior. It means as they fit to new data I would expect they need to constantly update the prior - that feels really quite odd to me
- This is really quite a long lengthscale in many settings and I would expect it to negatively impact identifiability and performance during long periods of constant Rt (i.e locking in constant Rt beyond our prior expectations)
- Setting the max to the length of the time series as the default seems likely to lead to non-identifiability to me (support for a range of very nearly the same lengthscales)
- This has moved the prior to be normal vs lognormal unless I am missing a transformation. If there is a transformation what does this mean for the inverse gamma option
I know you have done some testing but I don't really believe our testing is deep enough to catch above.
My preference would be we update interface but keep the current defaults. I realise this could be a problem as it means we need to rescale in the model (I think)
I tend to agree with you here, and I hadn't thought about it like this. Just noting (not taking away from your point) that it's what is done in the Riutort-Mayol paper.
These could be easily address by changing the exact prior (which I mean to choose to roughly mirror the current prior with the examples). As far as I can see in the paper the example choices are Gamma(1.2, 0.2.)
This wasn't intended - not sure what happened there. The Inverse Gamma option has gone (as the lengthsacle can now be fixed).
Completely agree.
We could do this in preprocessing - just would be a bit tricky as we'd have to implement transformation by multiplying with a constant for all the distributions used. Not impossible, though, perhaps could even be done at |
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 13889e8 is merged into main:
|
Yup, I intentionally didn't implement it like this at the time. My view then was that they weren't really trying to implement something for reuse but just for their experiments and so they might not have thought about the implications of use across rolling periods and different datasets etc.
Yes agree
Yes, agree. Its not ideal. Wouldn't it be divide by a constant? The reason I said in model is that this makes it much more flexible (as some prior distributions might be hard to rescale). If we wanted a quick fix this would also be much easier (though at the cost of some efficiency). Having sat on this I am happy if you want to set this issue aside for this PR (i.e. make it a new issue and gather some feedback thoughts on if this is really a problem for people). |
I already did this in 922f0c9 - I also have a version where the scaling happens in R, which I'll put in a separate issue/PR combo |
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.
Nice looks good to me.
Description
This PR closes #878.
In order for there to be a prior choice that applies across applications it rescales the lengthscale with half the length of the time series as done in Riutort-Mayol et al. It also fixes the minimum to zero (for now) which was previously the default but changeable.
Todo before merging:
Todo after merging (future PRs):
Initial submission checklist
devtools::test()
anddevtools::check()
).devtools::document()
).lintr::lint_package()
).After the initial Pull Request