Calculate whether outbreaks went extinct or not
detect_extinct(outbreak_df_week, cap_cases, week_range = 12:16)
a data.table
: weekly cases produced by the
outbreak model
a positive integer
scalar: number of cumulative cases at
which the branching process (simulation) was terminated
a positive integer
vector: giving the (zero indexed)
week range to test for whether an extinction occurred. Default is 12:16
.
A data.table
, with two columns sim
and extinct
, for a binary
classification of whether the outbreak went extinct in each simulation
replicate. 1
is an outbreak that went extinct, 0
if not.
The cap_cases
argument should be equal to the value supplied to
outbreak_model()
(possibly passed from scenario_sim()
or
parameter_sweep()
).
res <- scenario_sim(
n = 10,
initial_cases = 1,
prop_asymptomatic = 0,
prop_ascertain = 0.2,
cap_cases = 4500,
cap_max_days = 350,
r0_isolated = 0.5,
r0_community = 2.5,
disp_community = 0.16,
disp_isolated = 1,
onset_to_isolation = \(x) rweibull(n = x, shape = 1.65, scale = 4.28),
incubation_period = \(x) rweibull(n = x, shape = 2.322737, scale = 6.492272),
prop_presymptomatic = 0.5,
quarantine = FALSE
)
detect_extinct(outbreak_df_week = res, cap_cases = 4500)
#> sim extinct
#> <int> <num>
#> 1: 1 1
#> 2: 2 1
#> 3: 3 1
#> 4: 4 1
#> 5: 5 1
#> 6: 6 1
#> 7: 7 1
#> 8: 8 1
#> 9: 9 1
#> 10: 10 0