bcp (version 4.0.3)

summary.bcp: Summarizing Bayesian change point analysis results

Description

Summary and print methods for class bcp.

Usage

# S3 method for bcp
summary(object, digits = max(3, .Options$digits - 3), ...)

# S3 method for bcp print(x, digits = max(3, .Options$digits - 3), ...)

Arguments

object

the result of a call to bcp().

digits

the number of digits displayed in the summary statistics.

...

(optional) additional arguments, ignored.

x

the result of a call to bcp().

Value

The matrix of results is returned invisibly.

Details

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.

See Also

bcp and plot.bcp.

Examples

Run this code
# 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