| fastcpd_wrapper | R Documentation |
Wraps the fastcpd package (Li and Zhang, 2024), a modern PELT-family
engine that pairs pruning with sequential gradient descent so that exact or
near-exact segmentations of many model families run in near-linear time.
Every family the engine documents is reachable except its user-supplied
custom cost: Gaussian mean, variance and both; the count and
binary families ("poisson", "binomial") and waiting times
("exponential"); linear and penalised regression ("lm",
"lasso") and generalised linear models ("poisson",
"binomial" with covariates); and the time-series models
"ar", "arma", "arima", "garch" and, for a
multivariate series, "var".
fastcpd_wrapper(
x,
family = c("mean", "variance", "meanvariance", "ar", "arma", "arima", "garch", "var",
"lm", "lasso", "poisson", "binomial", "exponential"),
order = NULL,
covariates = NULL,
...
)
x |
A numeric vector, or (for |
family |
Model family. |
order |
Model order for |
covariates |
Optional numeric matrix of regressors, one row per
observation, for |
... |
Additional arguments passed to the corresponding
|
A ggcpt object. The engine's per-segment parameter
estimates (thetas) are kept as $coefficients, one row
per segment and parameter, for the families where they are
coefficients (the regressions and the intercept-only count, binary and
waiting-time models).
li2024fastcpdggchangepoint
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(),
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()
set.seed(2026)
res <- fastcpd_wrapper(c(rnorm(100), rnorm(100, 4)))
res$changepoints
# A change in a Poisson rate
counts <- fastcpd_wrapper(c(rpois(100, 3), rpois(100, 9)),
family = "poisson")
counts$changepoints
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.