View source: R/Finalised_coding.R
| ID_plm | R Documentation |
This function estimates the number and locations of multiple change-points
in the slope of a continuous piecewise-linear 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).
ID_plm(x, thr_id = 1.4, th_ic_id = 1.25, pointsth = 3, pointsic = 10)
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.4. 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 |
th_ic_id |
A positive real number with default value equal to 1.25. 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. |
Firstly, this function detects the change-points using wind_plm_th.
If the estimated number of change-points is larger than 100, then the
result is returned and we stop. Otherwise, ID_plm proceeds to detect the
change-points using cpt_ic_plm and this is what is returned. To sum up,
ID_plm returns a result based on cpt_ic_plm 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.
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 continuous piecewise-linear
mean signal.
solution_path A vector containing the solution path.
Andreas Anastasiou, anastasiou.andreas@ucy.ac.cy
wind_plm_th and cpt_ic_plm which are the functions that ID_plm
is based on. In addition, see ID_pcm for the case of detecting changes in the mean of a
piecewise-constant signal. The main function ID of the package employs ID_plm.
single.cpt <- c(seq(0, 999, 1), seq(998.5, 499, -0.5))
single.cpt.noise <- single.cpt + rnorm(2000)
cpt.single <- ID_plm(single.cpt.noise)
three.cpt <- c(seq(0, 499, 1), seq(498.5, 249, -0.5), seq(250,1249,2), seq(1248,749,-1))
three.cpt.noise <- three.cpt + rnorm(2000)
cpt.three <- ID_plm(three.cpt.noise)
multi.cpt <- rep(c(seq(0,49,1), seq(48,0,-1)),20)
multi.cpt.noise <- multi.cpt + rnorm(1980)
cpt.multi <- ID_plm(multi.cpt.noise)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.