# Use the example data set
data(mcmcListExample)
mco <- mcmcOutput(mcmcListExample)
plot(mco)
plot(mco, "p") # plots p[1,1], p[2,2] and psi
plot(mco, "p[") # plots p[1,1] and p[2,2], not psi
# Generate some data
normal <- rnorm(1e5, 2, 1)
postPlot(normal)
postPlot(normal, col='wheat', border='magenta')
postPlot(normal, CRImass=0.8, compVal=0, ROPE=c(-0.2,0.2),
xlab="Response variable")
postPlot(normal, center="mode", showCurve=TRUE, compVal=5.5)
# For integers:
integers <- rpois(1e5, 12)
postPlot(integers)
# A severely bimodal distribution:
bimodal <- c(rnorm(1e5), rnorm(5e4, 7))
postPlot(bimodal) # A valid 95% CrI, but not HDI
postPlot(bimodal, showCurve=TRUE) # Correct 95% HDI
postPlot(bimodal, showCurve=TRUE, shadeHDI='pink')
Run the code above in your browser using DataLab