plot.atwins.Rd
Plot results of fitting a twins model using MCMC output. Plots similar to those in the Held et al. (2006) paper are generated
# S3 method for atwins
plot(x, which=c(1,4,6,7), ask=TRUE, ...)
An object of class atwins
.
a vector containing the different plot types to show
A plot of the observed time series Z is shown together with posterior means for the number of endemic cases (X) and number of epidemic cases (Y).
This plot shows trace plots of the gamma parameters over all MCMC samples.
This shows a trace plot of psi, which controls the overdispersion in the model.
Autocorrelation functions for K and psi are shown in order to judge whether the MCMC sampler has converged.
Shows a plot of the posterior mean of the seasonal model nu[t] together with 95% credibility intervals based on the quantiles of the posterior.
Histograms illustrating the posterior density for K and psi. The first one corresponds to Fig. 4(f) in the paper.
Histograms illustrating the predictive posterior density for the next observed number of cases Z[n+1]. Compare with Fig.5 in the paper.
Boolean indicating whether to ask for a newline before showing the next plot.
Additional control for the plots, which are currently ignored.
For details see the plots in the paper. Basically MCMC output is
visualized. This function is together with algo.twins
still
experimental.
This function does not return anything.
Held, L., Hofmann, M., Höhle, M. and Schmid V. (2006) A two-component model for counts of infectious diseases, Biostatistics, 7, pp. 422--437.
M. Hofmann and M. Höhle
if (FALSE) {
#Apparently, the algo.atwins can crash on some LINUX systems
#thus for now the example section is commented
#Load the data used in the Held et al. (2006) paper
data("hepatitisA")
#Fix seed - this is used for the MCMC samplers in twins
set.seed(123)
#Call algorithm and save result
otwins <- algo.twins(hepatitisA)
#This shows the entire output
plot(otwins,which=c(1,2),ask=FALSE)
}