condition_on_known.Rd
Condition on known cases
condition_on_known( sims, days_since_end_seed = NULL, lower_bound = NULL, upper_bound = NULL )
sims | A data.table from |
---|---|
days_since_end_seed | Numeric, the number of days since the end of the seeding event. |
lower_bound | Numeric, the estimated lower bound on cases. |
upper_bound | Numeric, the estimated upper bound on cases. |
A data.table of conditioned scenarios
## Example sims <- data.table::data.table( time = rep(1:10, 10), size = rep(1:10, 10), sample = unlist(lapply(1:10, function(.) {rep(., 10)})), scenario = c(rep(1, 5), rep(1, 5)), tmp = c(rep(1, 5), rep(1, 5)), event_duration = 1 ) sims <- data.table::data.table(scenario = 1:10, sample = 1:10, size = 1:10, event_duration = rep(c(1, 2), 5), time = 1:10) condition_on_known(sims, upper_bound = 5, lower_bound = 3, days_since_end_seed = 0)#> Empty data.table (0 rows and 4 cols): scenario,sample,size,event_duration## Code condition_on_known#> function (sims, days_since_end_seed = NULL, lower_bound = NULL, #> upper_bound = NULL) #> { #> time <- NULL #> event_duration <- NULL #> size <- NULL #> out <- sims[time == event_duration + days_since_end_seed & #> size < upper_bound & size > lower_bound, !"time"] #> return(out) #> } #> <bytecode: 0x55a6b0d30f68> #> <environment: namespace:WuhanSeedingVsTransmission>