Run a specified number of simulations with identical parameters

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

Arguments

n.sim

number of simulations to run

prop.ascertain

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

cap_max_days

Stop the simulation when this many days is reached.

cap_cases

Stop the simulation when this many cases is reached.

r0isolated

numeric reproduction number for isolated cases (must be >0)

r0community

numeric reproduction number for non-isolated cases (must be >0)

disp.iso

numeric dispersion parameter for isolated cases (must be >0)

disp.com

numeric dispersion parameter for non-isolated cases (must be >0)

k

numeric skew parameter for sampling the serial interval from the incubation period

delay_shape

numeric shape parameter of delay distribution

delay_scale

numeric scale parameter of delay distribution

num.initial.cases

The number of initial or starting cases which are all assumed to be missed.

prop.asym

proportion of cases that are completely asymptomatic.

quarantine

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

r0subclin

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

disp.subclin

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

Value

A data.table object returning the results for multiple simulations using the same set of parameters. The table has columns

  • week: The week in the simulation.

  • weekly_cases: The number of new cases that week.

  • cumulative: The cumulative cases.

  • effective_r0: The effective reproduction rate for the whole simulation

  • cases_per_gen: A list column with the cases per generation. This is repeated each row.

  • sim: Index column for which simulation.

Author

Joel Hellewell

Examples

if (FALSE) {
res <- scenario_sim(n.sim = 5,
num.initial.cases = 5,
cap_max_days = 365,
cap_cases = 2000,
r0isolated = 0,
r0community = 2.5,
disp.iso = 1,
disp.com = 0.16,
k = 0.7,
delay_shape = 2.5,
delay_scale = 5,
prop.asym = 0,
prop.ascertain = 0)
}