summary.bcp {bcp} | R Documentation |
Summary and print methods for class bcp
.
## S3 method for class 'bcp' summary(object, digits = max(3, .Options$digits - 3), ...) ## S3 method for class 'bcp' print(x, digits = max(3, .Options$digits - 3), ...)
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
##### 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. }