epilike {EpiILM} | R Documentation |
Calculates the log likelihood for the specified individual level model and data set
epilike (type, x = NULL, y = NULL, inftime, infperiod = NULL, tmin = NULL, tmax, alpha, beta, spark = NULL, Sformula = NULL, contact = NULL)
type |
Type of compartment framework, with the choice of "SI" for Susceptible-Infectious diseases and "SIR" for Susceptible-Infectious-Removed |
x |
X coordinates of individuals |
y |
Y coordinates of individuals |
inftime |
Infection times |
infperiod |
Length of infectious period for each individual |
tmin |
The first time point at which data is observed, default value is one |
tmax |
The last time point at which data is observed |
alpha |
Susceptibility parameter(>0) |
beta |
Spatial parameter(s) (>0) or network parameter (s) (>0) if contact is used |
spark |
Sparks parameter(>=0), representing infections unexplained by other parts of the model or infections coming in from outside the observed population, default value is zero |
Sformula |
An object of class formula. See formula Individual-level covariate information passable through this argument. An expression of the form |
contact |
Contact network matrix (matrices) |
Deardon R, Brooks, S. P., Grenfell, B. T., Keeling, M. J., Tildesley, M. J., Savill, N. J., Shaw, D. J., Woolhouse, M. E. (2010). Inference for individual level models of infectious diseases in large populations. Statistica Sinica, 20, 239-261.
## Example 1: spatial SI model # generate 100 individuals ## Not run: x <- runif(100, 0, 10) y <- runif(100, 0, 10) covariate <- runif(100, 0, 2) out <- epidata(type = "SI", n = 100, Sformula = ~covariate, tmax = 15, alpha = c(0.1, 0.3), beta = 5.0, x = x, y = y) epilike(type = "SI", x = x, y = y, inftime = out$inftime, tmax = 15, alpha = c(0.1, 0.3), beta = 5, Sformula = ~covariate) ## End(Not run) ## Example 2: spatial SIR model # generate infectious period (=3) for 100 individuals ## Not run: lambda <- rep(3, 100) out <- epidata(type = "SIR", n = 100, tmax = 15, alpha =0.3, beta = 5.0, infperiod = lambda, x = x, y = y) epilike(type = "SIR", x = x, y = y, infperiod = lambda, inftime = out$inftime, tmax = 15, alpha = 0.3, beta = 5.0) ## End(Not run)