Skip to content
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

Merged
merged 11 commits into from
Jul 20, 2021

Conversation

sangeetabhatia03
Copy link
Collaborator

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

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.
@sangeetabhatia03 sangeetabhatia03 changed the base branch from master to multiv July 18, 2021 18:26
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) {
Copy link
Collaborator

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?

Copy link
Collaborator

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?

Copy link
Collaborator

@annecori annecori left a 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.
@annecori annecori merged commit cd12ba3 into multiv Jul 20, 2021
@sangeetabhatia03 sangeetabhatia03 deleted the fix_tmin branch July 20, 2021 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants