Run a single instance of the branching process model

outbreak_model(
  num.initial.cases = NULL,
  prop.ascertain = NULL,
  cap_max_days = NULL,
  cap_cases = NULL,
  r0isolated = NULL,
  r0community = NULL,
  r0subclin = NULL,
  disp.iso = NULL,
  disp.com = NULL,
  disp.subclin = NULL,
  k,
  delay_shape = NULL,
  delay_scale = NULL,
  prop.asym = NULL,
  quarantine = NULL
)

Arguments

num.initial.cases

a nonnegative integer scalar: number of initial or starting cases which are all assumed to be missed.

prop.ascertain

a nonnegative numeric scalar: proportion of infectious contacts ascertained by contact tracing (must be 0<=x<=1)

cap_max_days

a positive integer scalar: stop the simulation when this many days is reached.

cap_cases

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

r0isolated

a positive numeric scalar: reproduction number for isolated cases (must be >0)

r0community

a positive numeric scalar: reproduction number for non-isolated cases (must be >0)

r0subclin

a positive numeric scalar: reproduction number for sub-clinical non-isolated cases (must be >0)

disp.iso

a positive numeric scalar: dispersion parameter for isolated cases (must be >0)

disp.com

a positive numeric scalar: dispersion parameter for non-isolated cases (must be >0)

disp.subclin

a positive numeric scalar: dispersion parameter for sub-clincial non-isolated cases (must be >0)

k

a numeric scalar: skew parameter for sampling the serial interval from the incubation period

delay_shape

a positive numeric scalar: shape parameter of delay distribution

delay_scale

a positive numeric scalar: scale parameter of delay distribution

prop.asym

a nonnegative numeric scalar: proportion of cases that are completely asymptomatic (sublinical) (between 0 and 1)

quarantine

a logical scalar: whether quarantine is in effect, if TRUE then traced contacts are isolated before symptom onset

Value

data.table of cases by week, cumulative cases, and the effective reproduction number of the outbreak. data.table columns are:

  • $week: numeric

  • $weekly_cases: numeric

  • $cumulative: numeric

  • $effective_r0: numeric

  • $cases_per_gen: list

Author

Joel Hellewell

Examples

set.seed(1)
out <- outbreak_model(
  num.initial.cases = 1,
  prop.ascertain = 0.2,
  cap_max_days = 350,
  cap_cases = 4500,
  r0isolated = 0.5,
  r0community = 2.5,
  r0subclin = 2.5,
  disp.iso = 1,
  disp.com = 0.16,
  disp.subclin = 0.16,
  k = 0,
  delay_shape = 1.65,
  delay_scale = 4.28,
  prop.asym = 0,
  quarantine = FALSE
)
out
#>      week weekly_cases cumulative effective_r0 cases_per_gen
#>     <num>        <num>      <num>        <num>        <list>
#>  1:     0            0          0            1           2,0
#>  2:     1            3          3            1           2,0
#>  3:     2            0          3            1           2,0
#>  4:     3            0          3            1           2,0
#>  5:     4            0          3            1           2,0
#>  6:     5            0          3            1           2,0
#>  7:     6            0          3            1           2,0
#>  8:     7            0          3            1           2,0
#>  9:     8            0          3            1           2,0
#> 10:     9            0          3            1           2,0
#> 11:    10            0          3            1           2,0
#> 12:    11            0          3            1           2,0
#> 13:    12            0          3            1           2,0
#> 14:    13            0          3            1           2,0
#> 15:    14            0          3            1           2,0
#> 16:    15            0          3            1           2,0
#> 17:    16            0          3            1           2,0
#> 18:    17            0          3            1           2,0
#> 19:    18            0          3            1           2,0
#> 20:    19            0          3            1           2,0
#> 21:    20            0          3            1           2,0
#> 22:    21            0          3            1           2,0
#> 23:    22            0          3            1           2,0
#> 24:    23            0          3            1           2,0
#> 25:    24            0          3            1           2,0
#> 26:    25            0          3            1           2,0
#> 27:    26            0          3            1           2,0
#> 28:    27            0          3            1           2,0
#> 29:    28            0          3            1           2,0
#> 30:    29            0          3            1           2,0
#> 31:    30            0          3            1           2,0
#> 32:    31            0          3            1           2,0
#> 33:    32            0          3            1           2,0
#> 34:    33            0          3            1           2,0
#> 35:    34            0          3            1           2,0
#> 36:    35            0          3            1           2,0
#> 37:    36            0          3            1           2,0
#> 38:    37            0          3            1           2,0
#> 39:    38            0          3            1           2,0
#> 40:    39            0          3            1           2,0
#> 41:    40            0          3            1           2,0
#> 42:    41            0          3            1           2,0
#> 43:    42            0          3            1           2,0
#> 44:    43            0          3            1           2,0
#> 45:    44            0          3            1           2,0
#> 46:    45            0          3            1           2,0
#> 47:    46            0          3            1           2,0
#> 48:    47            0          3            1           2,0
#> 49:    48            0          3            1           2,0
#> 50:    49            0          3            1           2,0
#> 51:    50            0          3            1           2,0
#>      week weekly_cases cumulative effective_r0 cases_per_gen