# NOT RUN {
##### A random sample from a few normal distributions #####
testdata <- c(rnorm(50), rnorm(50, 5, 1), rnorm(50))
bcp.0 <- bcp(testdata)
summary(bcp.0)
plot(bcp.0, main="Univariate Change Point Example")
##### An MCMC summary from the ``coda'' package #####
# }
# NOT RUN {
if (require("coda")) {
bcp.0 <- bcp(testdata, return.mcmc=TRUE)
bcp.mcmc <- as.mcmc(t(bcp.0$mcmc.means))
summary(bcp.mcmc)
heidel.diag(bcp.mcmc) # an example convergence diagnostic
# from the coda package.
}
# }
Run the code above in your browser using DataLab