Move forward one generation in the branching process
outbreak_step(
case_data = NULL,
disp.iso = NULL,
disp.com = NULL,
r0isolated = NULL,
r0community = NULL,
prop.asym = NULL,
incfn = NULL,
delayfn = NULL,
prop.ascertain = NULL,
k = NULL,
quarantine = NULL,
r0subclin = NULL,
disp.subclin = NULL
)
a data.table
: cases in outbreak so far; initially
generated by outbreak_setup()
a positive numeric
scalar: dispersion parameter for
isolated cases (must be >0)
a positive numeric
scalar: dispersion parameter for
non-isolated cases (must be >0)
a positive numeric
scalar: reproduction number for
isolated cases (must be >0)
a positive numeric
scalar: reproduction number for
non-isolated cases (must be >0)
a nonnegative numeric
scalar: proportion of cases that
are completely asymptomatic (sublinical) (between 0 and 1)
a function
that samples from incubation period Weibull
distribution; generated using dist_setup()
a function
that samples from the onset-to-hospitalisation
delay Weibull distribution; generated using dist_setup()
a nonnegative numeric
scalar: proportion of
infectious contacts ascertained by contact tracing (must be 0<=x<=1)
a numeric
scalar: skew parameter for sampling the serial
interval from the incubation period
a logical
scalar: whether quarantine is in effect, if
TRUE
then traced contacts are isolated before symptom onset
a positive numeric
scalar: reproduction number for
sub-clinical non-isolated cases (must be >0)
a positive numeric
scalar: dispersion parameter for
sub-clincial non-isolated cases (must be >0)
A list
with three elements:
$cases
: a data.table
with case data
$effective_r0
: a numeric
with the effective reproduction number
$cases_in_gen
: a numeric
with the number of new cases in that
generation
# incubation period sampling function
incfn <- dist_setup(dist_shape = 2.32, dist_scale = 6.49)
# delay distribution sampling function
delayfn <- dist_setup(dist_shape = 1.65, dist_scale = 4.28)
# generate initial cases
case_data <- outbreak_setup(
num.initial.cases = 5,
incfn = incfn,
delayfn = delayfn,
k = 1.95,
prop.asym = 0
)
case_data
#> exposure asym caseid infector missed onset new_cases isolated_time
#> <num> <lgcl> <int> <num> <lgcl> <num> <lgcl> <num>
#> 1: 0 FALSE 1 0 TRUE 4.385409 NA 5.985869
#> 2: 0 FALSE 2 0 TRUE 3.446895 NA 5.047355
#> 3: 0 FALSE 3 0 TRUE 9.163309 NA 10.763769
#> 4: 0 FALSE 4 0 TRUE 3.989371 NA 5.589831
#> 5: 0 FALSE 5 0 TRUE 6.167557 NA 7.768017
#> isolated
#> <lgcl>
#> 1: FALSE
#> 2: FALSE
#> 3: FALSE
#> 4: FALSE
#> 5: FALSE
# generate next generation of cases
out <- outbreak_step(
case_data = case_data,
disp.iso = 1,
disp.com = 0.16,
disp.subclin = 0.16,
r0isolated = 0,
r0subclin = 1.25,
r0community = 2.5,
prop.asym = 0,
incfn = incfn,
delayfn = delayfn,
prop.ascertain = 0,
k = 1.95,
quarantine = FALSE
)
case_data <- out[[1]]
case_data
#> exposure asym caseid infector missed onset new_cases isolated_time
#> <num> <lgcl> <int> <num> <lgcl> <num> <num> <num>
#> 1: 0.000000 FALSE 1 0 TRUE 4.385409 1 5.985869
#> 2: 0.000000 FALSE 2 0 TRUE 3.446895 0 5.047355
#> 3: 0.000000 FALSE 3 0 TRUE 9.163309 0 10.763769
#> 4: 0.000000 FALSE 4 0 TRUE 3.989371 0 5.589831
#> 5: 0.000000 FALSE 5 0 TRUE 6.167557 0 7.768017
#> 6: 4.309422 FALSE 6 1 TRUE 8.740109 NA 13.278195
#> isolated
#> <lgcl>
#> 1: TRUE
#> 2: TRUE
#> 3: TRUE
#> 4: TRUE
#> 5: TRUE
#> 6: FALSE