breakfast {breakfast}  R Documentation 
Methods for fast detection of multiple changepoints
Description
This function estimates the number and locations of changepoints in a univariate data sequence, which is modelled as (i) a piecewiseconstant function plus i.i.d. Gaussian noise, (ii) a piecewiseconstant function plus autoregressive time series, (iii) a piecewiselinear and continuous function plus i.i.d. Gaussian noise, or (iv) a piecewiselinear and discontinuous function plus i.i.d. Gaussian noise. This is carried out via a twostage procedure combining solution path generation and model selection methodologies.
Usage
breakfast(
x,
type = c("const", "lin.cont", "lin.discont"),
solution.path = NULL,
model.selection = NULL
)
Arguments
x 
A numeric vector containing the data to be processed 
type 
The type of changepoint models fitted to the data; currently supported models are: piecewise constant signals ( 
solution.path 
A string or a vector of strings containing the name(s) of solution path generating method(s);
if individual methods are accessed via this option, default tuning parameters are used.
Alternatively, you can directly access each solution path generating method via When When If

model.selection 
A string or a vector of strings containing the name(s) of model selection method(s);
if individual methods are accessed via this option, default tuning parameters are used.
Alternatively, you can directly access each model selection method via

Details
Please also take a look at the vignette for tips/suggestions/examples of using the breakfast package.
Value
An S3 object of class breakfast.cpts
, which contains the following fields:
 x
Input vector
x
 cptmodel.list
A list containing S3 objects of class
cptmodel
; each contains the following fields:
 solution.path
The solution path method used
 model.selection
The model selection method used to return the final changepoint estimators object
 no.of.cpt
The number of estimated changepoints in the piecewiseconstant mean of the vector
cptpath.object$x
 cpts
The locations of estimated changepoints in the piecewiseconstant mean of the vector
cptpath.object$x
. These are the endpoints of the corresponding constantmean intervals est
An estimate of the piecewiseconstant mean of the vector
cptpath.object$x
; the values are the sample means of the data (replicated a suitable number of times) between each pair of consecutive detected changepoints
References
A. Anastasiou & P. Fryzlewicz (2022) Detecting multiple generalized changepoints by isolating single ones. Metrika, 85(2), 141–174.
R. Baranowski, Y. Chen & P. Fryzlewicz (2019) Narrowestoverthreshold detection of multiple change points and changepointlike features. Journal of the Royal Statistical Society: Series B, 81(3), 649–672.
H. Cho & C. Kirch (2022) Twostage data segmentation permitting multiscale change points, heavy tails and dependence. Annals of the Institute of Statistical Mathematics, 74(4), 653–684.
H. Cho & P. Fryzlewicz (2024) Multiple change point detection under serial dependence: Wild contrast maximisation and gappy Schwarz algorithm. Journal of Time Series Analysis, 45(3): 479–494.
P. Fryzlewicz (2014) Wild binary segmentation for multiple changepoint detection. The Annals of Statistics, 42(6), 2243–2281.
P. Fryzlewicz (2018) Tailgreedy bottomup data decompositions and fast multiple changepoint detection. The Annals of Statistics, 46(6B), 3390–3421.
P. Fryzlewicz (2020) Detecting possibly frequent changepoints: Wild Binary Segmentation 2 and steepestdrop model selection. Journal of the Korean Statistical Society, 49(4), 1027–1070.
Examples
f < rep(rep(c(0, 1), each = 50), 10)
x < f + rnorm(length(f)) * .5
breakfast(x)