
Robust depth-based changepoints for functional and multivariate data
Source:R/wrap-functional.R
kwc_wrapper.RdWraps KWCChangepoint (Ramsay and Chenouri): the functional Kruskal–Wallis covariance test, which ranks observations by statistical depth and segments on the ranks. Because it never touches the values themselves it is insensitive to heavy tails and outlying curves, which is exactly where the moment-based functional tests degrade.
Arguments
- x
A numeric matrix or data frame with one row per observation (time point) and one column per grid location or coordinate.
- algorithm
"fkwc"(default; pruned exact linear time over the depth ranks) or"dwbs"(depth-based wild binary segmentation).- depth
Depth function. For
"fkwc"one of"RPD"(default),"FM","LTR","FMd","RPDd"; for"dwbs"one of"spat","hs","mahal","mahal75".- change_in
Reported change type:
"covariance"(default) or"distribution". The test is sensitive to both; this only labels the result.- seed
Optional seed — the random-projection depths and the wild binary segmentation both randomise.
- ...
Additional arguments passed to the engine.
References
Ramsay K, Chenouri S (2025). “Robust changepoint detection in the variability of multivariate functional data.” Journal of Nonparametric Statistics. doi:10.1080/10485252.2025.2503891 .
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(),
hdcov_wrapper(),
hdreg_wrapper(),
idetect_wrapper(),
inspect_wrapper(),
kcp_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)
X <- matrix(rnorm(100 * 20), nrow = 100)
X[51:100, ] <- X[51:100, ] * 3
kwc_wrapper(X, seed = 1)
#> ggcpt (changepoint detection result)
#> Method: kwc
#> Change in: covariance
#> Changepoints found: 1
#> CP convention: left
#> Penalty: fkwc
#> Series length: 100
#>
#> Changepoints:
#> # A tibble: 1 × 2
#> cp cp_value
#> <int> <dbl>
#> 1 50 -0.240