rSEIR: Simulates from a simple stochastic SEIR epidemic model.

Description Usage Arguments Value Examples

View source: R/rSEIR.R

Description

rSEIR returns a matrix contains information about time, number of susceptible people, exposed people, infected people, recover people, total number of people.

Usage

1
2
3
4
5
6
7
8
9
rSEIR(
  N0 = 1000,
  S0 = 999,
  I0 = 0,
  E0 = 0,
  R0 = N0 - I0 - E0,
  days = 100,
  pars = c(3, 2, 2, 1, 0.9, 0.3, 0.1)
)

Arguments

N0

An integer. The population size at time 0.

S0

An integer. The initial number of susceptible people.

I0

An integer. The initial number of infected people.

E0

An integer. The initial number of exposed people.

R0

An integer. The initial number of recovered people.

days

An integer. The number of days for which to simulate.

pars

A numeric vector: (a.rate, e.rate, i.rate, r.rate, pE, pSR, pIm). Description about pars *a.rate represents rate of arrival of people into the population. *e.rate represents individual effective contact rate. *i.rate represents the incubation period is 1/i.rate days. *r.rate represents recovery time for each infected individual is 1/ r.rate. *pE represents probability that an arrival is exposed. *pSR represents probability that an exposed individual self-recover and turns susceptible. *pIm represents probability that an infected person is immune after recovery.

Value

A numeric matrix with 6 columns. Row i contains the values of (t, S_t, E_t, I_t, R_t, N_t) at time t.

Examples

1
2
3
4
model1 <- rSEIR(N0 = 100, S0 = 99,  I0 = 0, E0 = 1 , R0 = 0,
                days = 100,  pars = c(1/12, 1, 1/4, 1/5, 0.3, 0.2, 0.7))
model1
print(model1)

jessseliu/epidmod documentation built on Sept. 15, 2020, 8:53 p.m.