# NOT RUN {
## 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)
epilike(out1, tmax = 15,
sus.par = c(0.1, 0.3), beta = 5, Sformula = ~covariate)
## 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)
epilike(out2,
tmax = 15, sus.par = 0.3, beta = 5.0)
# }
Run the code above in your browser using DataLab