wbsts_wrapper: WBS for nonstationary time series

View source: R/wrap-applied.R

wbsts_wrapperR Documentation

WBS for nonstationary time series

Description

Wraps wbsts::wbs.lsw() (Korkas and Fryzlewicz): wild binary segmentation applied to the locally stationary wavelet spectrum, so it detects changes in the second-order structure (variance and autocovariance) of a nonstationary series. Where wbs looks for jumps in the level, this looks for jumps in how the series behaves.

Usage

wbsts_wrapper(
  x,
  n_intervals = 0,
  cstar = 0.75,
  lambda = 0.75,
  scales = NULL,
  seed = NULL,
  ...
)

Arguments

x

A numeric vector.

n_intervals

Number of random intervals (M). Defaults to 0, which is the engine's "all dyadic intervals" setting.

cstar

The unbalancedness parameter c_\star of the search: a candidate split may leave at most this fraction of its interval on either side. Between 0.5 and 1; defaults to the engine's 0.75.

lambda

How many wavelet scales are used when scales is NULL: floor(3 * lambda * log(log(n))) of them, from the finest down. Defaults to the engine's 0.75.

scales

Wavelet scales to use: at least two different whole numbers from 1 to floor(log2(n)) - 1. NULL lets the engine choose.

seed

Optional seed. 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 wbsts::wbs.lsw().

Value

A ggcpt object with change_in = "var".

References

\insertRef

korkas2017wbstsggchangepoint

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(), 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()

Examples



set.seed(2026)
y <- c(as.numeric(stats::arima.sim(list(ar = 0.1), 250)),
       as.numeric(stats::arima.sim(list(ar = 0.9), 250)))
wbsts_wrapper(y)



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