Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/Finalised_coding.R
This function performs the Isolate-Detect methodology (see Details for the
relevant literature reference) with the thresholding-based stopping rule
in order to detect multiple change-points in the mean of a noisy input vector
x
, with Gaussian noise. See Details for a brief explanation of the
Isolate-Detect methodology, and of the thresholding-based stopping rule.
1 2 3 |
x |
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 |
thr_const |
A positive real number with default value equal to 1. It is
used to define the threshold; see |
thr_fin |
With |
s, e |
Positive integers with |
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; see Details for more information. |
k_l, k_r |
Positive integer numbers that get updated whenever the function calls itself during the detection process. They are not essential for the function to work, and we include them only to reduce the computational time. |
The change-point detection algorithm that is used in pcm_th
is the
Isolate-Detect methodology described in “Detecting multiple generalized
change-points by isolating single ones”, Anastasiou and Fryzlewicz (2018), preprint.
The concept is simple and is split into two stages; firstly, isolation of each
of the true change-points in subintervals of the data domain, and secondly their detection.
ID first creates two ordered sets of K = \lceil T/\code{points}\rceil right- and left-expanding
intervals as follows. The j^{th} right-expanding interval is R_j = [1, j\times \code{points}],
while the j^{th} left-expanding interval is L_j = [T - j\times \code{points} + 1, T].
We collect these intervals in the ordered set S_{RL} = \lbrace R_1, L_1, R_2, L_2, ... , R_K, L_K\rbrace.
For a suitably chosen contrast function, ID first identifies the point with the maximum contrast
value in R_1. If its value exceeds a certain threshold, then it is taken as a change-point.
If not, then the process tests the next interval in S_{RL} and repeats the above process.
Upon detection, the algorithm makes a new start from estimated location.
A numeric vector with the detected change-points.
Andreas Anastasiou, a.anastasiou@lse.ac.uk
win_pcm_th
, ID_pcm
, and ID
, which employ
this function. In addition, see cplm_th
for the case of detecting changes in
a continuous, piecewise-linear signal via thresholding.
1 2 3 4 5 6 7 8 9 10 11 | single.cpt <- c(rep(4,1000),rep(0,1000))
single.cpt.noise <- single.cpt + rnorm(2000)
cpt.single.th <- pcm_th(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)
cpt.three.th <- pcm_th(three.cpt.noise)
multi.cpt <- rep(c(rep(0,50),rep(3,50)),20)
multi.cpt.noise <- multi.cpt + rnorm(2000)
cpt.multi.th <- pcm_th(multi.cpt.noise)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.