wbs.cpt {breakfast}R Documentation

Multiple change-point detection in the mean of a vector using the (Adaptive) WBS method.

Description

This function estimates the number and locations of change-points in the piecewise-constant mean of the noisy input vector, using the (Adaptive) Wild Binary Segmentation method (see Details for the relevant literature references). The constant means between each pair of neighbouring change-points are also estimated. The method works best when the noise in the input vector is independent and identically distributed Gaussian.

Usage

wbs.cpt(x, sigma = stats::mad(diff(x)/sqrt(2)), M.bic = 20000,
  Kmax = ceiling(length(x)/5), universal = TRUE, M.thresh = NULL,
  th.const = NULL, th.const.min.mult = 0.825, adapt = TRUE,
  lambda = 0.9)

Arguments

x

A vector containing the data in which you wish to find change-points.

sigma

Only relevant to the wbs.thresh.cpt part (see Details below); the same as the corresponding parameter in wbs.thresh.cpt.

M.bic

Only relevant to the wbs.bic.cpt part (see Details below); the same as the M parameter in wbs.bic.cpt.

Kmax

Only relevant to the wbs.bic.cpt part (see Details below); the same as the corresponding parameter in wbs.bic.cpt.

universal

Only relevant to the wbs.thresh.cpt part (see Details below); the same as the corresponding parameter in wbs.thresh.cpt.

M.thresh

Only relevant to the wbs.thresh.cpt part (see Details below); the same as the M parameter in wbs.thresh.cpt.

th.const

Only relevant to the wbs.thresh.cpt part (see Details below); the same as the corresponding parameter in wbs.thresh.cpt.

th.const.min.mult

Only relevant to the wbs.thresh.cpt part (see Details below); the same as the corresponding parameter in wbs.thresh.cpt.

adapt

Only relevant to the wbs.thresh.cpt part (see Details below); the same as the corresponding parameter in wbs.thresh.cpt.

lambda

Only relevant to the wbs.thresh.cpt part (see Details below); the same as the corresponding parameter in wbs.thresh.cpt.

Details

This is a hybrid method, which returns the result of wbs.thresh.cpt or wbs.bic.cpt, whichever of the two detect the larger number of change-points. If there is a tie, wbs.bic.cpt is returned.

The change-point detection algorithms used in wbs.thresh.cpt are: standard Wild Binary Segmentation [see "Wild Binary Segmentation for multiple change-point detection", P. Fryzlewicz (2014), Annals of Statistics, 42, 2243-2281] and Adaptive Wild Binary Segmentation [see "Data-adaptive Wild Binary Segmentation", P. Fryzlewicz (2017), in preparation as of September 28th, 2017].

Value

A list with the following components:

est

The estimated piecewise-constant mean of x.

no.of.cpt

The estimated number of change-points in the piecewise-constant mean of x.

cpt

The estimated locations of change-points in the piecewise-contant mean of x (these are the final indices before the location of each change-point).

Author(s)

Piotr Fryzlewicz, p.fryzlewicz@lse.ac.uk

See Also

segment.mean, wbs.bic.cpt, wbs.thresh.cpt, tguh.cpt, hybrid.cpt, wbs.K.cpt

Examples

teeth <- rep(rep(0:1, each=5), 20)
teeth.noisy <- teeth + rnorm(200)/5
teeth.cleaned <- wbs.cpt(teeth.noisy)
ts.plot(teeth.cleaned$est)

[Package breakfast version 1.0.0 Index]