R/aux_functions.R
extinct_prob.Rd
Calculate proportion of runs that have controlled outbreak
extinct_prob(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 single numeric
with the probability of extinction
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
)
extinct_prob(res, cap_cases = 4500)
#> [1] 0.9