not_wrapper: NOT wrapper: Narrowest-Over-Threshold

View source: R/wrap-search.R

not_wrapperR Documentation

NOT wrapper: Narrowest-Over-Threshold

Description

Wraps the not package for changepoint detection via the Narrowest-Over-Threshold method. The contrast determines what change is detected: piecewise-constant mean (default), mean and variance, or (continuous or discontinuous) piecewise-linear trend.

Usage

not_wrapper(x, contrast = "pcwsConstMean", seed = NULL, ...)

Arguments

x

A numeric vector.

contrast

Contrast type. One of "pcwsConstMean", "pcwsLinContMean", "pcwsLinMean", "pcwsConstMeanVar". Defaults to "pcwsConstMean".

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 not::not().

Value

A ggcpt object whose change_in reflects the contrast: "mean", "meanvar", or "slope".

References

\insertRef

baranowski2019narrowestggchangepoint

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(), idetect_wrapper(), inspect_wrapper(), kcp_wrapper(), kwc_wrapper(), mcp_wrapper(), mosum_wrapper(), network_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)
not_wrapper(c(rnorm(60), rnorm(60, 4)))$changepoints
# a change in slope, not in level: pick the contrast to match
trend <- c(1:60, 60 - 1:60) / 10 + rnorm(120)
not_wrapper(trend, contrast = "pcwsLinContMean")$changepoints


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