ID_pcm: Multiple change-point detection in the mean of a vector using...

View source: R/Finalised_coding.R

ID_pcmR Documentation

Multiple change-point detection in the mean of a vector using the Isolate-Detect method

Description

This function estimates the number and locations of multiple change-points in the piecewise-constant mean of the noisy input vector x, using the Isolate-Detect methodology. It also gives the estimated signal, as well as the solution path (see Details for the relevant literature reference).

Usage

ID_pcm(x, thr_id = 1, th_ic_id = 0.9, pointsth = 3, pointsic = 10)

Arguments

x

A numeric vector containing the data in which you would like to find change-points.

thr_id

A positive real number with default value equal to 1. It is used to define the threshold, if the thresholding approach is to be followed. In this case, the change-points are estimated by thresholding with threshold equal to sigma * thr_id * sqrt(2 * log(l)), where l is the length of the data sequence x.

th_ic_id

A positive real number with default value equal to 0.9. It is useful only if the model selection based Isolate-Detect method is to be followed and it is used to define the threshold value that will be used at the first step (change-point overestimation) of the model selection approach.

pointsth

A positive integer with default value equal to 3. It is used only when the threshold based approach is to be followed and it defines the distance between two consecutive end- or start-points of the right- or left-expanding intervals, respectively.

pointsic

A positive integer with default value equal to 10. It is used only when the information criterion based approach is to be followed and it defines the distance between two consecutive end- or start-points of the right- or left-expanding intervals, respectively.

Details

Firstly, this function detects the change-points using wind_pcm_th. If the estimated number of change-points is larger than 100, then the result is returned and we stop. Otherwise, ID_pcm proceeds to detect the change-points using cpt_ic_pcm and this is what is returned. To sum up, ID_pcm returns a result based on cpt_ic_pcm if the estimated number of change-points is less than 100. Otherwise, the result comes from thresholding. More details can be found in “Detecting multiple generalized change-points by isolating single ones”, Anastasiou and Fryzlewicz (2017), preprint.

Value

A list with the following components:

cpt A vector with the detected change-points.

no_cpt The number of change-points detected.

fit A numeric vector with the estimated piecewise-constant mean signal.

solution_path A vector containing the solution path.

Author(s)

Andreas Anastasiou, anastasiou.andreas@ucy.ac.cy

See Also

wind_pcm_th and cpt_ic_pcm which are the functions that ID_pcm is based on. In addition, see ID_plm for the case of detecting changes in the slope of a piecewise-linear and continuous signal. The main function ID of the package employs ID_pcm.

Examples

single.cpt <- c(rep(4,1000),rep(0,1000))
single.cpt.noise <- single.cpt + rnorm(2000)
cpts_detect <- ID_pcm(single.cpt.noise)

three.cpt <- c(rep(4,500),rep(0,500),rep(-4,500),rep(1,500))
three.cpt.noise <- three.cpt + rnorm(2000)
cpts_detect_three <- ID_pcm(three.cpt.noise)

multi.cpt <- rep(c(rep(0,50),rep(3,50)),20)
multi.cpt.noise <- multi.cpt + rnorm(2000)
cpts_detect_multi <- ID_pcm(multi.cpt.noise)

IDetect documentation built on May 7, 2026, 5:09 p.m.