Learn R Programming

bcp (version 2.1.2)

interval.prob: The probability of a change point in a specified interval.

Description

From a bcp object (with return.mcmc=TRUE), interval.prob() calculates the probability of a change point in a specified interval.

Usage

interval.prob(object, start, end)

Arguments

object
the result of a call to bcp().
start
the starting index of the interval.
end
the ending index of the interval.

Details

The function returns the posterior probability of at least one change point in the specified interval.

See Also

bcp and plot.bcp.

Examples

Run this code
##### A random sample from a few normal distributions #####
  testdata <- c(rnorm(50), rnorm(50, 5, 1), rnorm(50))
  bcp.0 <- bcp(testdata, return.mcmc=TRUE)
  plot.bcp(bcp.0)
  interval.prob(bcp.0, 45, 55)

Run the code above in your browser using DataLab