SEIRdelay_MNRM_C: SEIR model with fixed delay via Modified Next Reaction Method...

Description Usage Arguments Details Examples

View source: R/SEIRdelay-MNRM.R

Description

Using the Modified Next Reaction Method (MNRM) for delays, simulate a SEIR model where the time spent in the E compartment is a deterministic period of length tau.

Usage

1
SEIRdelay_MNRM_C(tmax, S0, I0, beta, nu, tau, verbose = T, maxsize = 1e+06)

Arguments

tmax

maximum time of simulation

S0

initial number of susceptibles

I0

initial number of infectives

beta

effective contact rate

nu

duration of infectiousness

tau

duration of latent period fixed delay

verbose

print diagnostic information

maxsize

maximum size of output matrix; simulation will return early if this is exceeded

Details

The MNRM is described in: Anderson, D. F. (2007). A modified next reaction method for simulating chemical systems with time dependent propensities and delays. Journal of Chemical Physics, 127(21). https://doi.org/10.1063/1.2799998

Examples

1
2
3
4
5
6
7
 ## Not run: 
   out <- SEIRdelay_MNRM_C(tmax = 1e3,S0 = 1000,I0 = 5,beta = 0.001,nu = 1/5,tau = 10,verbose = TRUE)
   outd <- discretize(out)
   matplot(outd[,-1],type="l",col=c("blue","orange","red","purple"),lwd=1.5,lty=1,ylab="Count",xlab="Days")
   legend(x = "topleft",pch=rep(16,4),col=c("blue","orange","red","purple"),legend=c("S","E","I","R"))

## End(Not run)

dd-harp/delay documentation built on April 1, 2020, 2:33 a.m.