Perform the Double CUSUM Binary Segmentation algorithm detecting change points in the mean or second-order structure of the data.
dcbs.alg(
x,
cp.type = c(1, 2)[1],
phi = 0.5,
thr = NULL,
trim = NULL,
height = NULL,
tau = NULL,
temporal = TRUE,
scales = NULL,
diag = FALSE,
B = 1000,
q = 0.01,
do.parallel = 4
)S3 bin.tree object, which contains the following fields:
a list object containing information about the nodes at which change points are detected
matrix concatenation of the nodes of tree
estimated change points
threshold used to construct the tree
input data matrix, with each row representing the component time series
cp.type = 1 specifies change points in the mean, cp.type = 2 specifies change points in the second-order structure
choice of parameter for weights in Double CUSUM statistic; 0 <= phi <= 1 or phi = -1 allowed with the latter leading to the DC statistic combining phi = 0 and phi = 1/2, see Section 4.1 of Cho (2016) for further details
pre-defined threshold values; when thr = NULL, bootstrap procedure is employed for the threshold selection; when thr != NULL and cp.type = 1, length(thr) should be one, if cp.type = 2, length(thr) should match length(scales)
length of the intervals trimmed off around the change point candidates; trim = NULL activates the default choice (trim = round(log(dim(x)[2])))
maximum height of the binary tree; height = NULL activates the default choice (height = floor(log(dim(x)[2], 2)/2))
a vector containing the scaling constant for each row of x; if tau = NULL, a data-driven choice is made which takes into account the presence of possibly multiple mean shifts and temporal dependence when temporal = TRUE
used when cp.type = 1; if temporal = FALSE, rows of x are scaled by mad estimates, if temporal = TRUE, their long-run variance estimates are used
used when cp.type = 2; negative integers representing Haar wavelet scales to be used for computing nrow(x)*(nrow(x) + 1)/2 dimensional wavelet transformation of x; a small negative integer represents a fine scale
used when cp.type = 2; if diag = TRUE, only changes in the diagonal elements of the autocovariance matrices are searched for
used when is.null(thr); number of bootstrap samples for threshold selection
used when is.null(thr); indicates the quantile of bootstrap test statistics to be used for threshold selection
used when is.null(thr); number of copies of R running in parallel, if do.parallel = 0, %do% operator is used, see also foreach
H. Cho (2016) change point detection in panel data via double CUSUM statistic. Electronic Journal of Statistics, vol. 10, pp. 2000--2038.
x <- matrix(rnorm(10*100), nrow = 10)
dcbs.alg(x, cp.type = 1, phi=.5, temporal = FALSE, do.parallel = 0)$ecp
# \donttest{
x <- matrix(rnorm(100*300), nrow = 100)
x[1:10, 151:300] <- x[1:10, 151:300] + 1
dcbs.alg(x, cp.type = 1, phi=-1, temporal = FALSE, do.parallel = 0)$ecp
# }
Run the code above in your browser using DataLab