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, ...)

Arguments

x

An object of class atwins.

which

a vector containing the different plot types to show

1

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).

2

This plot shows trace plots of the gamma parameters over all MCMC samples.

3

This shows a trace plot of psi, which controls the overdispersion in the model.

4

Autocorrelation functions for K and psi are shown in order to judge whether the MCMC sampler has converged.

5

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.

6

Histograms illustrating the posterior density for K and psi. The first one corresponds to Fig. 4(f) in the paper.

7

Histograms illustrating the predictive posterior density for the next observed number of cases Z[n+1]. Compare with Fig.5 in the paper.

ask

Boolean indicating whether to ask for a newline before showing the next plot.

...

Additional control for the plots, which are currently ignored.

Details

For details see the plots in the paper. Basically MCMC output is visualized. This function is together with algo.twins still experimental.

Value

This function does not return anything.

References

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.

Author

M. Hofmann and M. Höhle

See also

Examples

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)
}