Description Usage Arguments Value References See Also Examples
Computing the posterior predictive check based on different summary statistics.
1 2 3 | pred.epi (object, xx, criterion , n.samples, burnin = NULL, tmin = NULL,
Sformula = NULL, Tformula = NULL, showProgressBar = interactive())
|
object |
An object of class |
xx |
An object of class |
criterion |
The (multivariate) statistical criteria used in the posterior predictive check. It has three options: “newly infectious” which is a multivariate statistics represented by the number of newly infectious individuals over time, “epidemic length” represents the length of epidemic, and “peak time” represents the time of the peak of epidemic. |
n.samples |
The number of epidemics that needs to be simulated in the posterior predictive check procedure. |
burnin |
A scalar value which represents the number of samples needs to be discarded from the MCMC output. |
tmin |
The first time point at which the infection occurs, default value is one. |
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 |
showProgressBar |
logical. If TRUE a progress bar is shown. |
An object of class pred.epi
that contains the following:
The compartmental framework model used in the analysis.
The (multivariate) statistical criteria used in the posterior predictive check.
The output of the evaluated criterion
on the simulated epidemics.
The output of the evaluated criterion
on the observed epidemics.
The last time point at which data is observed.
The number of simulated epidemics used in the posterior predictive check procedure.
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.
epimcmc
, epidata
, epilike
, plot.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 | ## Example 1: spatial SI model
# generate 100 individuals
set.seed(59991)
x <- runif(100, 0, 10)
y <- runif(100, 0, 10)
covariate <- cbind(runif(100, 0, 2), rbinom(100, 1, 0.5))
out <- epidata(type = "SI",n = 100, Sformula = ~covariate, tmax = 15,
sus.par = c(0.1, 0.3, 0.01), beta = 5.0, x = x, y = y)
alphapar2 <- matrix(c(1, 1, 1, 1, 1, 1), ncol = 2, nrow = 3)
betapar2 <- c(1, 1)
epi<-epimcmc(object = out, tmin = 1, tmax = 15,
niter = 500, sus.par.ini = c(1, 1, 1), beta.ini = 1,
Sformula = ~covariate,
pro.sus.var = c(0.5, 0.3, 0.2), pro.beta.var = 0.1,
prior.sus.dist = c("gamma", "gamma", "gamma"),
prior.beta.dist = "gamma",
prior.sus.par = alphapar2, prior.beta.par = betapar2,
adapt = TRUE, acc.rate = 0.5)
epipred1 <- pred.epi (object = out, xx = epi,
criterion = "newly infectious",
n.samples = 100, burnin = 200, tmin = 1,
Sformula = ~covariate)
plot(epipred1, col = "red", type = "b", lwd = 2)
epipred2 <- pred.epi (object = out, xx = epi,
criterion = "peak time",
n.samples = 100, burnin = 200, tmin = 1,
Sformula = ~covariate)
plot(epipred2, col = "dark gray")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.