Simulates epidemic for the specified model type and parameters
Simulates epidemic for the specified model type and parameters
This function allows the user to simulate epidemics under different models and scenarios
epidata (type, n, tmin =NULL, tmax, sus.par, trans.par =NULL, beta =NULL, spark =NULL, Sformula =NULL, Tformula =NULL, x =NULL, y =NULL, inftime =NULL, infperiod =NULL, contact =NULL)
Arguments
type: Type of compartment framework, with the choice of "SI" for Susceptible-Infectious diseases and "SIR" for Susceptible-Infectious-Removed.
n: Population size
tmin: The time point at which simulation begins, default value is one.
tmax: The last time point of simulation.
sus.par: Susceptibility parameter (>0).
trans.par: Transmissibility parameter (>0).
beta: Spatial parameter(s) (>0) or network parameter (s) (>0) if contact network is used.
spark: Sparks parameter (>=0), representing infections unexplained by other parts of the model (eg. infections coming in from outside the observed population), default value is zero.
Sformula: An object of class formula. See formula .
Individual-level covariate information associated with susceptibility can be passed through this argument. An expression of the form ~ model is interpreted as a specification that the susceptibility function, ΩS(i) is modelled by a linear predictor specified symbolically by the model term. Such a model consists of a series of terms separated by + and - operators. If there is no susceptibility covariate information, Sformula is null.
Tformula: An object of class formula. See formula .
Individual-level covariate information associated with transmissibility can be passed through this argument. An expression of the form ~ -1+model is interpreted as a specification that the transmissibility function, ΩT(j) is modelled by a linear predictor specified symbolically by the model terms without the incorporation of the intercept term. Such a model consists of a series of terms separated by + and - operators. If there is no transmissibility covariate information, Tformula is null.
x: X coordinates of individuals.
y: Y coordinates of individuals.
inftime: Times at which individuals are infected to initialize epidemic simulation.
infperiod: Length of infectious period for each individual.
contact: A contact network matrix or an array of contact network matrices.
Details
We consider following two individual level models:
where P(i,t) is the probability that susceptible individual i is infected at time point t, becoming infectious at time t+1; ΩS(i) is a susceptibility function which accommodates potential risk factors associated with susceptible individual i contracting the disease; ΩT(j) is a transmissibility function which accommodates potential risk factors associated with infectious individual j; ε is a sparks term which represents infections originating from outside the population being observed or some other unobserved infection mechanism.
The susceptibility function can incorporate any individual-level covariates of interest and ΩS(i) is treated as a linear function of the covariates, i.e., c("OmegaS(i)=alpha0+alpha1X1(i)+alpha2X2(i)+dots+\n", "alphansXns(i)"), where X1(i),…,Xns(i) denote nscovariates associated with susceptible individual i, along with susceptibility parameters α0,…,αns>0. If the model does not contain any susceptibility covariates then ΩS(i)=α0 is used. In a similar way, the transmissibility function can incorporate any individual-level covariates of interest associated with infectious individual. ΩT(j) is also treated as a linear function of the covariates, but without the intercept term, i.e., ΩT(j)=ϕ1X1(j)+ϕ2X2(j)+⋯+ϕntXnt(j), where X1(j),…,Xnt(j) denote the nt covariates associated with infectious individual j, along with transmissibility parameters ϕ1,…,ϕnt>0. If the model does not contain any transmissibility covariates then ΩT(j)=1 is used.
Returns
An object of class epidata is returned containing the following:
type: Type of compartment framework, with the choice of "SI" for Susceptible-Infectious diseases and "SIR" for Susceptible-Infectious-Removed
XYcoordinates: The XY-coordinates of individuals.
contact: Contact network matrix.
inftime: The infection times of individuals.
remtime: The removal times of individuals when type = ``SIR''.
See Also
plot.epidata, epimcmc, epilike, pred.epi.
Examples
## Example 1: spatial SI model# generate 100 individualsx <- runif(100,0,10)y <- runif(100,0,10)covariate <- runif(100,0,2)out1 <- epidata(type ="SI",n =100, Sformula =~covariate, tmax =15, sus.par = c(0.1,0.3), beta =5.0, x = x, y = y)# Plots of epidemic progression (optional)plot(out1, plottype ="spatial")plot(out1, plottype ="curve", curvetype ="newinfect")## Example 2: spatial SIR model# generate infectious period(=3) for 100 individualslambda <- rep(3,100)out2 <- epidata(type ="SIR", n =100, tmax =15, sus.par =0.3, beta =5.0, infperiod = lambda, x = x, y = y)plot(out2, plottype ="spatial")plot(out2, plottype ="curve", curvetype ="newinfect")## Example 3: SI network modelcontact1 <- matrix(rbinom(10000,1,0.1), nrow =100, ncol =100)contact2 <- matrix(rbinom(10000,1,0.1), nrow =100, ncol =100)diag(contact1[,])<-0diag(contact2[,])<-0contact <- array(c(contact1, contact2), dim = c(100,100,2))out3 <- epidata(type ="SI", n =100, tmax =15, sus.par =0.3, beta = c(3.0,5.0), contact = contact)plot(out3, plottype ="curve", curvetype ="complete")plot(out3, plottype ="curve", curvetype ="susceptible")plot(out3, plottype ="curve", curvetype ="newinfect")plot(out3, plottype ="curve", curvetype ="totalinfect")
References
Deardon, R., Brooks, S. P., Grenfell, B. T., Keeling, M. J., Tildesley, M. J., Savill, N. J., Shaw, D. J., and Woolhouse, M. E. (2010). Inference for individual level models of infectious diseases in large populations. Statistica Sinica, 20, 239-261.
Deardon, R., Fang, X., and Kwong, G.P.S. (2014). Statistical modelling of spatio-temporal infectious disease transmission in analyzing and modeling Spatial and temporal dynamics of infectious diseases, (Ed: D. Chen, B. Moulin, J. Wu), John Wiley & Sons. Chapter 11.