##### A random sample from a few normal distributions #####
testdata <- c(rnorm(50), rnorm(50, 5, 1), rnorm(50))
bcp.0 <- bcp(testdata)
print.bcp(bcp.0)
plot.bcp(bcp.0)
##### An MCMC summary from the ``coda'' package #####
if(require("coda")) {
bcp.0 <- bcp(testdata, return.mcmc=TRUE)
BURNIN <- bcp.0$burnin
M <- bcp.0$burnin + bcp.0$mcmc
bcp.mcmc <- as.mcmc(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