View source: R/wrap-nonparam.R
| kcp_wrapper | R Documentation |
Wraps kcpRS::kcpRS() (Cabrieto et al., 2018; the KCP framework of
Arlot, Celisse and Harchaoui, 2019). The data are mapped to a running
statistic (mean, variance, autocorrelation, or correlation) computed on a
sliding window, and a Gaussian-kernel change point analysis with a
permutation significance test is run on the statistic. Detecting changes
in running correlations or variances captures higher-order changes that
mean-based methods miss. Multivariate input (matrix or data frame) is
supported.
kcp_wrapper(
x,
running_stat = c("mean", "var", "autocorr", "corr"),
wsize = 25,
nperm = 1000,
kmax = 10,
alpha = 0.05,
seed = NULL,
...
)
x |
A numeric vector, matrix, or data frame (columns are variables). |
running_stat |
Which running statistic to monitor: |
wsize |
Sliding window size for the running statistic. Defaults to
|
nperm |
Number of permutations for the significance test, at least 2.
Defaults to |
kmax |
Maximum number of changepoints considered. Defaults to
|
alpha |
Significance level of the permutation test. Defaults to
|
seed |
Optional seed for reproducibility of the permutation test.
The seed is scoped to this call: |
... |
Additional arguments passed to |
A ggcpt object. Reported locations refer to the centre of
the sliding window in which the change occurs. The series must be at
least wsize long to form one window. Constant coordinates make
every running statistic NA, so they are dropped (with a warning)
before detection and an all-constant input returns an empty result.
arlot2019kernelggchangepoint
\insertRefcabrieto2018kcprsggchangepoint
Other changepoint engines:
bcp_wrapper(),
beast_wrapper(),
bfast_wrapper(),
binsegrcpp_wrapper(),
bocpd_wrapper(),
capa_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(),
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()
res <- kcp_wrapper(c(rnorm(60), rnorm(60, 3)), nperm = 100, seed = 2026)
res$changepoints
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.