psi.sim.modelA: A Compartmental SIR Model

Description Usage Arguments Value Examples

View source: R/synthetic_fxns.R

Description

An R code for generating SIR profile(s) using either a stochastic or deterministic event-driven procedure. The routine calculates the weekly number of cases and if requested plots them. When using a stochastic procedure the user should set the number of realization to be > 50. When using a deterministic procedure the user should only ask for only one realization, see examples below.

Usage

1
2
3
psi.sim.modelA(R0 = 1.4, Tg = 2.6, t0 = 20, seed = 1, N = 10000,
  tps = (0:52) * 7, reals = 20, dt = 0.1, stochastic = TRUE,
  plot = TRUE)

Arguments

R0

Numeric - the basic reproduction number

Tg

Numeric - the recovery rate in days

t0

Numeric - the onset day of the epidemic

seed

Integer - the initial number of cases

N

Integer - the total population

tps

a numeric array of time points in days

reals

Integer - the number of requested realizations.

dt

Numeric - the time-step for the event-driven procedure

stochastic

Logical - if TRUE (default) use a stochastic event-driven procedure, otherwise use a deterministic procedure

plot

Logical - if TRUE plot the results

Value

rtn a numeric array with the weekly incidence of all requested realizations

Examples

1
2
psi.sim.modelA(R0 = 1.4, Tg = 2.6, t0 = 20, seed = 1, N = 1e4, tps = (0:52) * 7, reals = 100, dt = 0.2, stochastic = TRUE , plot = TRUE)
psi.sim.modelA(R0 = 1.4, Tg = 2.6, t0 = 20, seed = 1, N = 1e4, tps = (0:52) * 7, reals = 1  , dt = 0.2, stochastic = FALSE, plot = TRUE)

predsci/DICE documentation built on Aug. 9, 2019, 9:41 a.m.