Learn R Programming

breakfast (version 2.5)

breakfast: Methods for fast detection of multiple change-points

Description

This function estimates the number and locations of change-points in a univariate data sequence, which is modelled as (i) a piecewise-constant function plus i.i.d. Gaussian noise, (ii) a piecewise-constant function plus autoregressive time series, (iii) a piecewise-linear and continuous function plus i.i.d. Gaussian noise, or (iv) a piecewise-linear and discontinuous function plus i.i.d. Gaussian noise. This is carried out via a two-stage 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
)

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:

Arguments

x

A numeric vector containing the data to be processed

type

The type of change-point models fitted to the data; currently supported models are: piecewise constant signals (type = "const", chosen by default), piecewise linear and continuous signals (type = "lin.cont") and piecewise linear and discontinuous signals (type = "lin.discont").

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 sol.[method]. If both solution.path and model.selection are unspecified, we return the output from the suggested combinations based on their performance, which depends on type as below:

When type = "const": ("idetect", "ic"), ("idetect_seq", "thresh"), ("not", "ic"), ("tguh", "lp"), ("wbs", "ic"), ("wbs2", "sdll") and ("wcm", "gsa").

When type = "lin.cont" or type = "lin.discont": ("idetect_seq", "thresh"), ("not", "ic") and ("idetect", "sdll").

If solution.path is specified but model.selection is not, we return the output from the specified solution.path methods combined with the suggested model selection methods (respectively) as above.

"idetect"

IDetect, supporting type = "const", "lin.cont", "lin.discont", see sol.idetect

"idetect_seq"

Sequential IDetect, supporting type = "const", "lin.cont", "lin.discont", see sol.idetect_seq

"not"

Narrowest-Over-Threshold, supporting type = "const", "lin.cont", "lin.discont", see sol.not

"tguh"

Tail-Greedy Unbalanced Haar, supporting type = "const", see sol.tguh

"wbs"

Wild Binary Segmentation, supporting type = "const", see sol.wbs

"wbs2"

Wild Binary Segmentation 2, supporting type = "const", see sol.wbs2

"wcm"

Wild Contrast Maximisation, supporting type = "const" in combination with model.gsa handling model (ii), see sol.wcm

"all"

All of the above that support the type

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 model.[method]. If both solution.path and model.selection are unspecified, we return the output from the suggested combinations based on their performance, see solution.path. If model.selection is specified but solution.path is not, we return the output from the specified model.selection methods combined with the suggested solution path methods (respectively). Not all solution.path methods are supported by all model.selection methods; check the individual functions for more information.

"ic"

Strengthened Schwarz information criterion, supporting type = "const", "lin.cont", "lin.discont", see model.ic

"lp"

Localised pruning, supporting type = "const", see model.lp

"sdll"

Steepest Drop to Low Levels method, supporting type = "const", "lin.cont", "lin.discont", see model.sdll

"thresh"

Thresholding, supporting type = "const", "lin.cont", "lin.discont", see model.thresh

"gsa"

gappy Schwarz algorithm, supporting type = "const" in combination with sol.wcm handling model (ii), see model.gsa

"all"

All of the above that support the given type

Details

Please also take a look at the vignette for tips/suggestions/examples of using the breakfast package.

References

A. Anastasiou & P. Fryzlewicz (2022) Detecting multiple generalized change-points by isolating single ones. Metrika, 85(2), 141--174.

R. Baranowski, Y. Chen & P. Fryzlewicz (2019) Narrowest-over-threshold detection of multiple change points and change-point-like features. Journal of the Royal Statistical Society: Series B, 81(3), 649--672.

H. Cho & C. Kirch (2022) Two-stage 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 change-point detection. The Annals of Statistics, 42(6), 2243--2281.

P. Fryzlewicz (2018) Tail-greedy bottom-up data decompositions and fast multiple change-point detection. The Annals of Statistics, 46(6B), 3390--3421.

P. Fryzlewicz (2020) Detecting possibly frequent change-points: Wild Binary Segmentation 2 and steepest-drop model selection. Journal of the Korean Statistical Society, 49(4), 1027--1070.

Examples

Run this code
f <- rep(rep(c(0, 1), each = 50), 10)
x <- f + rnorm(length(f)) * .5
breakfast(x)

Run the code above in your browser using DataLab