wind_pcm_th: A window-based approach for multiple change-point detection...

View source: R/Finalised_coding.R

wind_pcm_thR Documentation

A window-based approach for multiple change-point detection in the mean via thresholding

Description

This function performs the windows-based variant of the Isolate-Detect methodology with the thresholding-based stopping rule in order to detect multiple change-points in the mean of a given data sequence. It is particularly helpful for very long data sequences, as due to applying Isolate-Detect on moving windows, it reduces the computational time (see Details for the relevant literature reference).

Usage

wind_pcm_th(
  xd,
  sigma = stats::mad(diff(xd)/sqrt(2)),
  thr_con = 1,
  c_win = 3000,
  w_points = 3,
  l_win = 12000
)

Arguments

xd

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

sigma

A positive real number. It is the estimate of the standard deviation of the noise in x. The default value is the median absolute deviation of x computed under the assumption that the noise is independent and identically distributed from the Gaussian distribution.

thr_con

A positive real number with default value equal to 1. It is used to define the threshold. The change-points are estimated by thresholding with threshold equal to sigma * thr_const * sqrt(2 * log(l)), where l is the length of the data sequence x.

c_win

A positive integer with default value equal to 3000. It is the length of each window for the data sequence in hand. Isolate-Detect will be applied in segments of the form [(i-1) * c_win + 1, i * c_win], for i=1,2,...,K, where K depends on the length T of the data sequence.

w_points

A positive integer with default value equal to 3. It defines the distance between two consecutive end- or start-points of the right- or left-expanding intervals, respectively.

l_win

A positive integer with default value equal to 12000. If the length of the data sequence is less than or equal to l_win, then the windows-based approach will not be applied and the result will be obtained by the classical Isolate-Detect methodology based on thresholding.

Details

The method that is implemented by this function is based on splitting the given data sequence uniformly into smaller parts (windows), to which Isolate-Detect is then applied. An idea of the computational improvement that this structure offers over the classical Isolate-Detect in the case of large data sequences is explained in the supplement of “Detecting multiple generalized change-points by isolating single ones”, Anastasiou and Fryzlewicz (2017), preprint.

Value

A numeric vector with the detected change-points.

Author(s)

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

See Also

pcm_th, which is the function that wind_pcm_th is based on. Also, see ID_pcm and ID, which employ wind_pcm_th. In addition, see wind_plm_th for the case of detecting changes in the slope of a piecewise-linear and continuous signal via thresholding.

Examples

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

three.cpt <- c(rep(4,4000),rep(0,4000),rep(-4,4000),rep(1,4000))
three.cpt.noise <- three.cpt + rnorm(16000)
cpt.three.th <- wind_pcm_th(three.cpt.noise)

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