| Title: | Change-Point Analysis of High-Dimensional Time Series via Binary Segmentation |
|---|---|
| Description: | Binary segmentation methods for detecting and estimating multiple change-points in the mean or second-order structure of high-dimensional time series as described in Cho and Fryzlewicz (2014) <doi:10.1111/rssb.12079> and Cho (2016) <doi:10.1214/16-EJS1155>. |
| Authors: | Haeran Cho [aut, cre], Piotr Fryzlewicz [aut] |
| Maintainer: | Haeran Cho <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 1.0.3 |
| Built: | 2026-06-06 06:34:03 UTC |
| Source: | https://github.com/cran/hdbinseg |
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 )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 )
x |
input data matrix, with each row representing the component time series |
cp.type |
|
phi |
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 |
thr |
pre-defined threshold values; when |
trim |
length of the intervals trimmed off around the change point candidates; |
height |
maximum height of the binary tree; |
tau |
a vector containing the scaling constant for each row of |
temporal |
used when |
scales |
used when |
diag |
used when |
B |
used when |
q |
used when |
do.parallel |
used when |
S3 bin.tree object, which contains the following fields:
tree |
a list object containing information about the nodes at which change points are detected |
mat |
matrix concatenation of the nodes of |
ecp |
estimated change points |
thr |
threshold used to construct the tree |
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 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)$ecpx <- matrix(rnorm(10*100), nrow = 10) dcbs.alg(x, cp.type = 1, phi=.5, temporal = FALSE, do.parallel = 0)$ecp 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
Generate thresholds for DCBS algorithm via bootstrapping
dcbs.thr( z, interval = c(1, dim(z)[2]), phi = 0.5, cp.type = 1, do.clean.cp = FALSE, temporal = TRUE, scales = NULL, diag = FALSE, sgn = NULL, B = 1000, q = 0.01, do.parallel = 4 )dcbs.thr( z, interval = c(1, dim(z)[2]), phi = 0.5, cp.type = 1, do.clean.cp = FALSE, temporal = TRUE, scales = NULL, diag = FALSE, sgn = NULL, B = 1000, q = 0.01, do.parallel = 4 )
z |
input data matrix, with each row representing the component time series |
interval |
a vector of two containing the start and the end points of the interval from which the bootstrap test statistics are to be calculated |
phi, cp.type, temporal, scales, diag, B, q, do.parallel
|
see |
do.clean.cp |
if |
sgn |
if |
a numeric value for the threshold
Perform the Sparsified Binary Segmentation algorithm detecting change-points in the mean or second-order structure of the data.
sbs.alg( x, cp.type = c(1, 2)[1], thr = NULL, trim = NULL, height = NULL, tau = NULL, temporal = TRUE, scales = NULL, diag = FALSE, B = 1000, q = 0.01, do.parallel = 4 )sbs.alg( x, cp.type = c(1, 2)[1], thr = NULL, trim = NULL, height = NULL, tau = NULL, temporal = TRUE, scales = NULL, diag = FALSE, B = 1000, q = 0.01, do.parallel = 4 )
x |
input data matrix, with each row representing the component time series |
cp.type |
|
thr |
pre-defined threshold values; when |
trim |
length of the intervals trimmed off around the change-point candidates; |
height |
maximum height of the binary tree; |
tau |
a vector containing the scaling constant for each row of |
temporal |
used when |
scales |
used when |
diag |
used when |
B |
used when |
q |
used when |
do.parallel |
used when |
S3 bin.tree object, which contains the following fields:
tree |
a list object containing information about the nodes at which change-points are detected |
mat |
matrix concatenation of the nodes of |
ecp |
estimated change-points |
thr |
threshold used to construct the tree |
H. Cho and P. Fryzlewicz (2014) Multiple-change-point detection for high dimensional time series via sparsified binary segmentation. JRSSB, vol. 77, pp. 475–507.
x <- matrix(rnorm(20*300), nrow = 20) sbs.alg(x, cp.type = 2, scales = -1, diag = TRUE, do.parallel = 0)$ecp x <- matrix(rnorm(100*300), nrow = 100) x[1:10, 151:300] <- x[1:10, 151:300]*sqrt(2) sbs.alg(x, cp.type = 2, scales = -1, diag = TRUE, do.parallel = 0)$ecpx <- matrix(rnorm(20*300), nrow = 20) sbs.alg(x, cp.type = 2, scales = -1, diag = TRUE, do.parallel = 0)$ecp x <- matrix(rnorm(100*300), nrow = 100) x[1:10, 151:300] <- x[1:10, 151:300]*sqrt(2) sbs.alg(x, cp.type = 2, scales = -1, diag = TRUE, do.parallel = 0)$ecp
Generate thresholds for SBS algorithm via bootstrapping
sbs.thr( z, interval = c(1, dim(z)[2]), cp.type = 1, do.clean.cp = TRUE, scales = NULL, diag = FALSE, sgn = NULL, B = 1000, q = 0.01, do.parallel = 4 )sbs.thr( z, interval = c(1, dim(z)[2]), cp.type = 1, do.clean.cp = TRUE, scales = NULL, diag = FALSE, sgn = NULL, B = 1000, q = 0.01, do.parallel = 4 )
z |
input data matrix, with each row representing the component time series |
interval |
a vector of two containing the start and the end points of the interval from which the bootstrap test statistics are to be calculated |
cp.type, scales, diag, B, q, do.parallel
|
see |
do.clean.cp |
if |
sgn |
if |
if cp.type = 1, a vector of length nrow(z), each containing the threshold applied to the CUSUM statistics from the corresponding coordinate of z
if cp.type = 2, a vector of length length(scales)*nrow(z) (when diag = TRUE) or length(scales)*nrow(z)*(nrow(z)+1)/2 (when diag = FALSE), each containing the threshold applied to the CUSUM statistics of the corresponding wavelet transformation of z