-
Notifications
You must be signed in to change notification settings - Fork 38
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
In estimate_joint, fix tmin to be the 95th percentile of the SI distribution #127
Conversation
To be conservative, I have chosen maximum across all variants. Also written a new test to check it works.
Updated vignette to use library rather than require
- Modified vignette to use library rather than require - explicitly set t_min to 2 in draw_R calls in tests because the default is set to NULL in estimate_joint - All tests for estimate_joint implicitly test cutoff as well.
R/gibbs_draws.R
Outdated
##' @author Sangeeta Bhatia | ||
##' @export | ||
compute_si_cutoff <- function(si_distr, miss_at_most = 0.05) { | ||
if (sum(si_distr) != 1) { |
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 suggests that si_distr is a vector here i.e. for a single variant, so I don't think you can inheritParams and you need to write a help for the si_distr param?
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.
actually a couple of lines below you use colSums; so not sure which is the correct one but they don't seem consistent with one another?
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.
Looks good but:
- I have a comment about the format of si_distr used in the new function to compute the quantile.
- I don't see a test for the new code?
- I wonder whether we should also add something to enforce t_min being after the first case of each variant, so that you can't start the estimation before the first case
t_min is now maximum day of non-zero incidence + max(95th percentile of SI distributions). Added tests for each bit.
I am specifying t_min as 2 in older tests now because they were set-up to work with that default.
If t_min is NULL, it is set to be the maximum of the 95th percentile of the SI distributions across all variants.
Added a test to check that it works as expected with a reasonable SI distribution.
All tests pass ok