Description Usage Arguments Details Value References See Also Examples
This function allows the user to simulate epidemics under different models and scenarios
1 2 3 4 5 6 7 |
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 |
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 |
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. |
We consider following two individual level models:
Spatial model:
P(i,t) =1- \exp\{-Ω_S(i) ∑_{j \in I(t)}{Ω_T(j)d_{ij}^{-β}- \varepsilon}\}
Network model:
P(i,t) =1- \exp\{-Ω_S(i) ∑_{j \in I(t)}{Ω_T(j)(β_1 C^{(1)}_{ij}} + … + β_n C^{(n)}_{ij} )- \varepsilon\}
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; \varepsilon 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., Ω_S(i) = α_0 + α_1 X_1(i) + α_2 X_2 (i) + … + α_{n_s} X_{n_s} (i), where X_1(i), …, X_{n_s} (i) denote n_scovariates associated with susceptible individual $i$, along with susceptibility parameters α_0,…,α_{n_s} >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) = φ_1 X_1(j) + φ_2 X_2 (j) + … + φ_{n_t} X_{n_t} (j), where X_1(j), …, X_{n_t} (j) denote the n_t covariates associated with infectious individual j, along with transmissibility parameters φ_1,…,φ_{n_t} >0. If the model does not contain any transmissibility covariates then Ω_T(j) = 1 is used.
An object of class epidata
is returned containing the following:
Type of compartment framework, with the choice of "SI" for Susceptible-Infectious diseases and "SIR" for Susceptible-Infectious-Removed
The XY-coordinates of individuals.
Contact network matrix.
The infection times of individuals.
The removal times of individuals when type
= “SIR”.
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.
plot.epidata
, epimcmc
, epilike
, pred.epi
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | ## Example 1: spatial SI model
# generate 100 individuals
x <- 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 individuals
lambda <- 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 model
contact1 <- matrix(rbinom(10000, 1, 0.1), nrow = 100, ncol = 100)
contact2 <- matrix(rbinom(10000, 1, 0.1), nrow = 100, ncol = 100)
diag(contact1[,] ) <- 0
diag(contact2[,] ) <- 0
contact <- 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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.