idetect_wrapper: Isolate-Detect wrapper

View source: R/wrap-search.R

idetect_wrapperR Documentation

Isolate-Detect wrapper

Description

Wraps the IDetect package. Requires the IDetect package.

Usage

idetect_wrapper(x, seed = NULL, ...)

Arguments

x

A numeric vector.

seed

Optional seed for reproducibility. The seed is scoped to this call: .Random.seed is saved and restored, so a seeded call inside a simulation loop does not pin the loop's own stream.

...

Additional arguments passed to IDetect::ID().

Value

A ggcpt object. When the engine finds no changepoints (including when it signals "No change-points found"), an empty result is returned rather than an error. A constant series likewise returns the empty result; see the note below.

Constant input

IDetect::ID() does not treat a flat series consistently: its statistics become 0/0, and what comes back depends on the value and the length. rep(3, 200) yields 126 changepoints, at 1, 3, 4, 6, 7, ...; rep(0, 100) raises "No change-points found"; rep(-2.5, 60) returns the sentinel 0. A constant series plainly has no changepoint, and every other search wrapper here reports none, so this one short-circuits to the empty result. Constancy is decided by exact equality, so a series with tiny but genuine variation still reaches the engine.

References

\insertRef

anastasiou2022idetectggchangepoint

See Also

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(), 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)
idetect_wrapper(c(rnorm(60), rnorm(60, 4)))$changepoints
# a flat series has no changepoint; see "Constant input" above
nrow(idetect_wrapper(rep(3, 100))$changepoints)


ggchangepoint documentation built on Nov. 5, 2026, 9:06 a.m.