wbs.bic.cpt {breakfast} | R Documentation |
This function estimates the number and locations of change-points in the piecewise-constant mean of the noisy input vector, using the Wild Binary Segmentation method (see Details for the relevant literature reference). The number of change-points is chosen via the Bayesian Information Criterion. 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, and when the number change-points is small.
wbs.bic.cpt(x, M = 20000, Kmax = ceiling(length(x)/5))
x |
A vector containing the data in which you wish to find change-points. |
M |
The number of randomly selected sub-segments of the data on which to build the CUSUM statistics in the Wild Binary Segmentation algorithm; generally, the larger the value of M, the more accurate but slower the algorithm - but see the remarks below about the BIC penalty. |
Kmax |
The maximum number of change-points that can be detected. |
The BIC penalty is unsuitable as a model selection tool in long signals
with frequent change-points; if you need a more versatile function that works well
regardless of the number of change-points, try segment.mean
(for a
default recommended estimation technique), wbs.thresh.cpt
,
wbs.cpt
(if you require an (Adaptive) WBS-based technique), tguh.cpt
(if you require a TGUH-based technique), or hybrid.cpt
(to use a hybrid between TGUH and Adaptive WBS). If you are unsure where to start, try
segment.mean
. (If you know how many change-points you wish to detect,
try wbs.K.cpt
.)
The change-point detection algorithm used in wbs.bic.cpt
is the
Wild Binary Segmentaton method as described in "Wild Binary Segmentation for multiple
change-point detection", P. Fryzlewicz (2014), Annals of Statistics, 42, 2243-2281.
A list with the following components:
est |
The estimated piecewise-constant mean of |
no.of.cpt |
The estimated number of change-points in the piecewise-constant mean of |
cpt |
The estimated locations of change-points in the piecewise-contant mean of |
Piotr Fryzlewicz, p.fryzlewicz@lse.ac.uk
segment.mean
, wbs.thresh.cpt
,
wbs.cpt
, tguh.cpt
, hybrid.cpt
, wbs.K.cpt
teeth <- rep(rep(0:1, each=5), 20) teeth.noisy <- teeth + rnorm(200)/5 teeth.cleaned <- wbs.bic.cpt(teeth.noisy) ts.plot(teeth.cleaned$est) teeth.cleaned$no.of.cpt teeth.cleaned$cpt