decafs_wrapper: DeCAFS wrapper: changes amid drift and autocorrelated noise

View source: R/wrap-robust.R

decafs_wrapperR Documentation

DeCAFS wrapper: changes amid drift and autocorrelated noise

Description

Wraps DeCAFS::DeCAFS() (Romano, Rigaill, Runge and Fearnhead, 2022), which detects abrupt mean changes when the underlying signal also drifts (random-walk fluctuations) and the noise is AR(1)-autocorrelated, the two regimes in which plain change-in-mean methods over-detect. Model parameters are estimated automatically unless supplied.

Usage

decafs_wrapper(x, penalty = NULL, model_param = NULL, ...)

Arguments

x

A numeric vector.

penalty

Penalty \beta for adding a changepoint. Defaults to 2 * log(length(x)). cpt_detect resolves its own "MBIC" default to a stronger numeric value (on a five-changepoint series that is 3 changepoints through the dispatcher against 5 here), so pass penalty explicitly when the two must agree.

model_param

Optional list of model parameters (sdEta, sdNu, phi) as accepted by DeCAFS::DeCAFS(); when NULL they are estimated from the data.

...

Additional arguments passed to DeCAFS::DeCAFS().

Value

A ggcpt object. The data tibble carries the estimated signal in its fitted column.

References

\insertRef

romano2022decafsggchangepoint

See Also

Other changepoint engines: bcp_wrapper(), beast_wrapper(), bfast_wrapper(), binsegrcpp_wrapper(), bocpd_wrapper(), capa_wrapper(), cpm_wrapper(), cpop_wrapper(), cpt_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(), 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)
res <- decafs_wrapper(c(rnorm(100), rnorm(100, 5)))
res$changepoints


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