Description Usage Arguments Value Examples
View source: R/synthetic_fxns.R
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.
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)
|
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 |
rtn a numeric array with the weekly incidence of all requested realizations
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.