ht_ID_pcm: Apply the Isolate-Detect methodology for multiple...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/Finalised_coding.R

Description

Using the Isolate-Detect methodology, this function estimates the number and locations of multiple change-points in the mean of the noisy, piecewise-constant input vector x, with noise that is not normally distributed. It also gives the estimated signal, as well as the solution path defined in sol_path_pcm. See Details for the relevant literature reference.

Usage

1
2
ht_ID_pcm(x, s.ht = 3, q_ht = 300, ht_thr_id = 1, ht_th_ic_id = 0.9,
  p_thr = 1, p_ic = 3)

Arguments

x

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

s.ht

A positive integer number with default value equal to 3. It is used to define the way we pre-average the given data sequence (see Details).

q_ht

A positive integer number with default value equal to 300. If the length of x is less than or equal to q_ht, then no pre-averaging will take place.

ht_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; see pcm_th for more details on the thresholding approach.

ht_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 described in pcm_ic. It is applied to the new data, which are obtained after we pre-average x.

p_thr

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

p_ic

A positive integer with default value equal to 3. It is used only when the information criterion based approach (described in pcm_ic) 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, in this function we call normalise, in order to create a new data sequence, \tilde{x}, by taking averages of observations in x. Then, we employ ID_pcm on \tilde{x}_q to obtain the change-points, namely \tilde{r}_1, \tilde{r}_2, ..., \tilde{r}_{\hat{N}} in increasing order. To obtain the original location of the change-points with, on average, the highest accuracy we define \hat{r}_k = (\tilde{r}_{k}-1)*\code{s.ht} + \lfloor \code{s.ht}/2 + 0.5 \rfloor, k=1, 2,..., \hat{N}. More details can be found in “Detecting multiple generalized change-points by isolating single ones”, Anastasiou and Fryzlewicz (2018), 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 signal.
solution_path A vector containing the solution path.

Author(s)

Andreas Anastasiou, a.anastasiou@lse.ac.uk

See Also

ID_pcm and normalise, which are functions that are used in ht_ID_pcm. In addition, see ht_ID_cplm for the case of continuous and piecewise-linear signals.

Examples

1
2
3
4
5
6
7
single.cpt <- c(rep(4,3000),rep(0,3000))
single.cpt.student <- single.cpt + rt(6000, df = 5)
cpts_detect <- ht_ID_pcm(single.cpt.student)

three.cpt <- c(rep(4,2000),rep(0,2000),rep(-4,2000),rep(0,2000))
three.cpt.student <- three.cpt + rt(8000, df = 5)
cpts_detect_three <- ht_ID_pcm(three.cpt.student)

IDetect documentation built on May 2, 2019, 11:04 a.m.

Related to ht_ID_pcm in IDetect...