datagen {EpiILMCT} | R Documentation |
Generate epidemics from distance-based and/or network-based continuous-time ILMs.
Description
Generate epidemics from distance-based and/or network-based ILMs.
Usage
datagen(type, kerneltype, kernelmatrix, distancekernel = NULL,
initialepi = NULL, tmax = NULL, suspar = NULL, transpar = NULL,
powersus = NULL, powertrans = NULL, kernel.par = NULL, spark = NULL,
gamma = NULL, delta, suscov = NULL, transcov = NULL)
Arguments
type |
type of compartmental framework, with the choice of “SIR” for Susceptible-Infectious-Removed and “SINR” for Susceptible-Infectious-Notified-Removed. |
kerneltype |
type of kernel function with choice of “distance” for a distance-based ILM, “network” for a contact network-based ILM and “both” for a combination of network- and distance-based ILM. |
kernelmatrix |
a matrix of the XY coordinates of individuals when |
distancekernel |
the spatial kernel type when |
initialepi |
a matrix of the initial |
tmax |
the time at which the epidemic simulation ends. If not set the simulation is run until the epidemic dies out or all individuals are infected and then enter the removed state. |
suspar |
parameter(s) for the susceptibility function (>0). Default value(s) is 1. |
transpar |
parameter(s) for the transmissibility function (>0). Default value(s) is 1. |
powersus |
the power parameter(s) of the susceptibility function (>0). Default value(s) is 1. |
powertrans |
the power parameter(s) of the transmissibility function (>0). Default value(s) is 1. |
kernel.par |
a scalar spatial parameter when |
spark |
spark parameter (>=0), representing random infections that are unexplained by other parts of the model. Default value is 0. |
gamma |
the notification effect parameter for SINR model. The default value is 1. |
delta |
a vector of the shape and rate parameters of the gamma-distributed infectious period (SIR) or a |
suscov |
covariate matrix of the susceptibility function, representing each covariate in a column. If intercept exists or in the case of no covariates, the first column is set to unity. |
transcov |
covariate matrix of the transmissibility function, representing each covariate in a column. If intercept exists or in the case of no covariates, the first column is set to unity. |
Details
We consider the simulation of epidemics from continuous-time ILMs in the following way. Each infected individual has an infection life history defined by their time of infection and the length of time spent in the infectious state. We are assuming the conditional intensity functions stay constant between events, so that the time to the next infected individual, given that the last infection occurred at time , is given by the minimum
, where
represents the “waiting time” for susceptible individual
becoming infected.
Under both SIR and SINR ILMs option, an epidemic is simulated using the specified model starting with a randomly chosen infected individual at time
, or as specified via the
initialepi
option. Under the SIR model, the rate of infection of each susceptible individual at time
follows the framework of Deardon et al. (2010):
where is the set of infectious individual at time
. Under the SINR model, the rate of infection of each susceptible individual
at time
follows Jewell et al. (2009):
where is the set of infectious individual at time
who have been infected but have not reached the notified state;
is the set of infectious individual at time
who have been infected and reached the notified state;
is the notification effect parameter usually allowing for infectious risk reduction after notification (Jewell et al., 2009);
is a function of risk factors associated with susceptible individual
(i.e., susceptibility); and
is a function of risk factors associated with infectious individual
(i.e., transmissibility). The
and
are defined as:
where and
are the parameters vectors of the susceptibility and transmissibility functions, respectively;
and
are the susceptibility and transmissibility risk factor matrices, respectively; and
and
are vectors of the power parameters of the susceptibility and transmissibility functions, respectively. These power parameters allow for nonlinear relationships between the susceptibility and transmissibility risk factors and the infection rate (Deardon et al., 2010).
The infection kernel allows for distance (spatial) and/or contact network-based mechanisms. In distance-based models, the kernel function
is a power-law or Cauchy function of distance. In network-based models, the kernel function
is the contact network elements (binary (
) or weighted (
)). In both distance-network-based models, the kernel function
is represented by two terms: (1) spatial function, and (2) the contact network.
The optional kernel function formulae are as follows:
-
Distance-based ILMs:
Power-law spatial kernel:
Cauchy spatial kernel:
-
Network-based ILMs:
-
for binary contact network or,
-
for weighted contact network.
-
-
Both distance- and network-based ILMs:
With power-law spatial kernel:
-
with binary contact network or,
-
with weighted contact network.
-
With Cauchy spatial kernel:
-
with binary contact network or,
-
with weighted contact network.
-
At time , the waiting time until being infected is drawn for each susceptible individual
from
. The individual with minimum
is chosen as the next infected individual, and assigned infection time
. Under SIR model, this newly-infected individual is also assigned an infectious period
generated from the infectious period (exponential or gamma) distribution
. Thus, its removal time becomes
. Under SINR model, each infected individual is assigned an incubation period defining the time from infection to notification, and a delay period defining the time from notification to removal. Thus, this newly-infected individual is assigned an incubation and delay period
and
, generated from the (exponential or gamma) incubation and delay periods distributions
and
, respectively. Thus, its notification and removal times become
and
, respectively. The process is repeated until no infectives remain in the population, or until
tmax
if it is specified.
Value
The function datagen
returns objects of class “datagen” containing the following:
- type:
The specified type of the compartmental framework.
- kerneltype:
The specified type of the kernel function.
- epidat:
Under an SIR ILM, it is a matrix with four columns representing the id numbers of the individuals, removal times, infectious periods, and infection times, respectively. Under an SINR ILM, it is a matrix with six columns: the id numbers of the individuals, removal times, delay periods, notification times, incubation periods, and infection times. Uninfected individuals are assigned infinity values
for both their removal and infection times. Note that the rows of
epidat
is sorted according to the infection times in ascending order. The id numbers of the individuals is used here to respresnt the corresponding row number oflocation
, contactnetwork
, and covariate matrices.- location:
A matrix of the XY coordinates of individuals if it is given in the function, otherwise, a zero matrix.
- network:
The contact network matrix if it is given in the function.
References
Jewell, C. P., Kypraios, T., Neal, P., and Roberts, G. O. (2009). Bayesian analysis for emerging infectious diseases. Bayesian Analysis, 4(3):465-496.
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(1):239.
See Also
loglikelihoodepiILM, contactnet, plot.datagen
.
Examples
set.seed(3245)
loc<- matrix(cbind(runif(100, 1, 100),runif(100, 1, 100)), ncol = 2, nrow = 100)
net1<- contactnet(type = "powerlaw", location = loc, beta = 0.9)
cov <- cbind(rep(1, 100), runif(100, 1, 50))
#To simulate the epidemic using the network kernel:
epi.net <- datagen(type = "SIR", kerneltype = "network",
kernelmatrix = net1, suspar = c(0.08, 0.05),
delta = c(4, 2), suscov = cov)
#To simulate the epidemic using the distance kernel:
epi.dis <- datagen(type = "SIR", kerneltype = "distance",
distancekernel = "powerlaw", kernelmatrix = loc,
suspar = c(0.8, 0.5), kernel.par = 2,
delta = c(4, 2), suscov = cov)