Wraps changepoints::BS.cov() (Wang, Yu and Rinaldo): binary
segmentation on the sample covariance operator, which detects a change in
the dependence structure of a multivariate series even when every
marginal mean and variance is unchanged. No other engine in the package
can see that.
Arguments
- x
A numeric matrix or data frame, rows as time points.
- threshold
Detection threshold on the CUSUM statistic. When
NULL(the default) it is calibrated by permutation: the time order is shuffledn_permtimes, which destroys any changepoint while preserving the marginal distributions, and the threshold is the1 - alphaquantile of the largest statistic seen.- alpha
Family-wise level for the permutation threshold. Defaults to
0.05.- n_perm
Permutations used to calibrate the threshold. Defaults to
20; raise it for a sharper threshold at proportional cost.- delta
Minimum spacing between changepoints. Defaults to
max(10, floor(n / 20)).- seed
Optional seed (the permutation calibration is random).
Value
A ggcpt object with change_in = "covariance"; the
changepoints tibble carries the CUSUM statistic in cusum.
References
Wang D, Yu Y, Rinaldo A (2021). “Optimal covariance change point localization in high dimensions.” Bernoulli, 27(1), 554–575. doi:10.3150/20-BEJ1249 .
See also
Other changepoint engines:
bcp_wrapper(),
beast_wrapper(),
bfast_wrapper(),
binsegrcpp_wrapper(),
bocpd_wrapper(),
cpm_wrapper(),
cpop_wrapper(),
cpt_wrapper(),
decafs_wrapper(),
ecp_wrapper(),
envcpt_wrapper(),
esac_wrapper(),
fabisearch_wrapper(),
fastcpd_wrapper(),
fcov_wrapper(),
fmean_wrapper(),
fpop_wrapper(),
geomcp_wrapper(),
hdreg_wrapper(),
idetect_wrapper(),
inspect_wrapper(),
kcp_wrapper(),
kwc_wrapper(),
mcp_wrapper(),
mosum_wrapper(),
network_wrapper(),
not_wrapper(),
npmojo_wrapper(),
nsp_wrapper(),
ocd_wrapper(),
pilliat_wrapper(),
segmented_wrapper(),
smuce_wrapper(),
sn_wrapper(),
strucchange_wrapper(),
taylor_wrapper(),
tguh_wrapper(),
trend_wrapper(),
var_wrapper(),
wbs2_wrapper(),
wbs_wrapper(),
wbsts_wrapper()
Examples
set.seed(2026)
p <- 5
A <- matrix(rnorm(100 * p), ncol = p)
B <- matrix(rnorm(100 * p), ncol = p)
B[, 2] <- B[, 1] + 0.2 * B[, 2] # correlation appears
hdcov_wrapper(rbind(A, B), n_perm = 20, alpha = 0.05, seed = 1)
#> ggcpt (changepoint detection result)
#> Method: hdcov
#> Change in: covariance
#> Changepoints found: 1
#> CP convention: left
#> Penalty: threshold = 7.666
#> Series length: 200
#>
#> Changepoints:
#> # A tibble: 1 × 3
#> cp cp_value cusum
#> <int> <dbl> <dbl>
#> 1 93 -0.475 8.22
