wbs.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 (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.
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)
x |
A vector containing the data in which you wish to find change-points. |
sigma |
Only relevant to the |
M.bic |
Only relevant to the |
Kmax |
Only relevant to the |
universal |
Only relevant to the |
M.thresh |
Only relevant to the |
th.const |
Only relevant to the |
th.const.min.mult |
Only relevant to the |
adapt |
Only relevant to the |
lambda |
Only relevant to the |
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].
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.bic.cpt
,
wbs.thresh.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.cpt(teeth.noisy) ts.plot(teeth.cleaned$est)