
EnvCpt wrapper — changepoints versus trends versus autocorrelation
Source:R/wrap-regression.R
envcpt_wrapper.RdWraps EnvCpt::envcpt() (Beaulieu and Killick, 2018), which fits up
to twelve competing models — constant mean or linear trend, each with or
without changepoints, and with white-noise, AR(1) or AR(2) errors — and
lets an information criterion decide whether the series really contains
changepoints or merely trend/autocorrelation ("memory"). The changepoints
of the winning model (if any) are returned, and the winning model's name
is recorded, guarding against the classic false positive of running a
mean-shift detector on autocorrelated data.
Arguments
- x
A numeric vector.
- models
Character vector of models to fit; see
EnvCpt::envcpt(). Defaults to all twelve.- criterion
Model selection criterion:
"AIC"(default) or"BIC".- minseglen
Minimum segment length. Defaults to
5.- ...
Additional arguments passed to
EnvCpt::envcpt().
Value
A ggcpt object. $fit holds the full envcpt
output; the selected model name is stored in the penalty descriptor and
printed by glance() via penalty_type.