ts_warma: WARMA

View source: R/ts_warma.R

ts_warmaR Documentation

WARMA

Description

Create a window-based ARMA-inspired regressor with local stepwise normalization for the ts_regsw workflow.

Usage

ts_warma(
  preprocess = ts_norm_none(),
  input_size = NA,
  input_map = ts_lagmap(),
  steps = NA,
  intercept = TRUE
)

Arguments

preprocess

External preprocessing object applied before the WARMA local steps. Defaults to ts_norm_none().

input_size

Integer. Number of lagged inputs used by the model.

input_map

Lag-selection strategy object created by ts_lagmap().

steps

Integer in ⁠{0, 1, 2}⁠ or NA. When NA, infer the smallest suitable step automatically.

intercept

Logical. Whether to include an intercept in the linear model fitted over the locally normalized lagged inputs.

Details

ts_warma() is a tspredit implementation inspired by the WARMA proposal: a window-based view of non-stationary series in which local preprocessing is interpreted in steps.

In this adaptation:

  • step 0 leaves the local window unchanged

  • step 1 subtracts the local mean of each window

  • step 2 subtracts the local mean and scales by the local standard deviation

The implementation follows the package's sliding-window lineage, so it uses the fully overlapping window regime naturally induced by ts_data(..., sw) and ts_regsw. The resulting representation is then modeled with a linear regressor over the normalized lagged inputs.

This makes ts_warma() a computationally light competitor to ts_darima() and a practical univariate block for the multivariate target-centered workflow.

When steps = NA, the model chooses the smallest step in ⁠{0, 1, 2}⁠ whose locally transformed reconstructed series reaches integration order zero according to forecast::ndiffs().

The current implementation should be understood as the tspredit interpretation of WARMA inside the package's object-oriented sliding-window pipeline. In other words, it is an adaptation aligned with ts_regsw, not a separate estimation framework detached from the rest of the library.

Value

A ts_warma object inheriting from ts_regsw.

References

  • Box GEP, Jenkins GM, Reinsel GC, Ljung GM (2015). Time Series Analysis: Forecasting and Control. Wiley.

  • Hyndman RJ, Athanasopoulos G (2021). Forecasting: Principles and Practice. Third Edition. OTexts. https://otexts.com/fpp3/

  • Ogasawara E, Pereira ACM, Bernardes GFR, Brandão AAF, Albuquerque MP (2010). Adaptive normalization: A novel data normalization approach for non-stationary time series. IJCNN.

  • Local WARMA manuscript used as implementation reference: 2026_04_SBBD_WARMA.pdf.

Examples

data(tsd)

ts <- ts_data(tsd$y, 8)
samp <- ts_sample(ts, test_size = 5)
io_train <- ts_projection(samp$train)
io_test <- ts_projection(samp$test)

model <- ts_warma(input_size = 5, steps = NA)
model <- daltoolbox::fit(model, io_train$input, io_train$output)

prediction <- predict(model, io_test$input[1, ], steps_ahead = 5)
prediction

tspredit documentation built on Sept. 9, 2026, 9:08 a.m.