Summary and print methods for class bcp
.
1 2 3 4 5 
object 
the result of a call to 
digits 
the number of digits displayed in the summary statistics. 
... 
(optional) additional arguments, ignored. 
x 
the result of a call to 
The functions print (and return invisibly) the estimated posterior probability of a change point for each position and the estimated posterior means. These results are modeled after the summary method of the coda
package (Plummer et al., 2006). If return.mcmc=TRUE
(i.e., if full MCMC results are returned), bcp
objects can be converted into mcmc
objects to view mcmc
summaries – see examples below.
The matrix of results is returned invisibly.
Xiaofei Wang, Chandra Erdman, and John W. Emerson
bcp
and plot.bcp
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14  ##### 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 #####
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.
}

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.