Calculate whether outbreaks went extinct or not

detect_extinct(outbreak_df_week = NULL, cap_cases = NULL, week_range = 12:16)

Arguments

outbreak_df_week

a data.table: weekly cases produced by the outbreak model

cap_cases

a positive integer scalar: number of cumulative cases at which the branching process (simulation) was terminated

week_range

a positive integer vector: giving the (zero indexed) week range to test for whether an extinction occurred.

Value

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.

Author

Joel Hellewell

Examples

res <- scenario_sim(
  n.sim = 10,
  num.initial.cases = 1,
  prop.asym = 0,
  prop.ascertain = 0.2,
  cap_cases = 4500,
  cap_max_days = 350,
  r0isolated = 0.5,
  r0community = 2.5,
  disp.com = 0.16,
  disp.iso = 1,
  delay_shape = 1.65,
  delay_scale = 4.28,
  k = 0,
  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       0
#>  6:     6       1
#>  7:     7       1
#>  8:     8       1
#>  9:     9       1
#> 10:    10       1