ts_mv_spec: Multivariate Model Specification

View source: R/ts_regsw_mv.R

ts_mv_specR Documentation

Multivariate Model Specification

Description

Wrap a univariate forecasting model so it can be orchestrated inside a multivariate workflow.

Usage

ts_mv_spec(model, variables = NULL, lags = NULL, transforms = NULL)

Arguments

model

Base model object. It can be a sliding-window regressor such as ts_mlp() or a raw-series model such as ts_arima().

variables

Optional character vector. Variables used as predictors for this submodel. When omitted, defaults depend on the context: target model uses all variables, auxiliary models use their own variable.

lags

Optional named list with one integer vector per variable. When omitted, each variable uses all lags from 0:(window_size-1).

transforms

Optional named list of raw-series transformations applied per variable before the multivariate windows are built. Each entry can be a single transform object or a list of transforms. These transformations act as variable-specific feature engineering and are orchestrated by the multivariate wrapper.

Details

ts_mv_spec() is the object-oriented contract that describes how one variable-specific predictive pipeline should be assembled inside ts_regsw_mv().

Each specification can declare:

  • model: the learner responsible for the variable

  • variables: which synchronized series are allowed as inputs to this learner

  • lags: which lag positions are extracted from each variable block

  • transforms: optional raw-series transformations applied per variable before the multivariate windows are built

This design lets different variables use different forecasting strategies while preserving a single orchestration contract. For example:

  • the target y may use ts_lstm(ts_norm_an(), ...)

  • x1 may use ts_mlp(ts_norm_diff(), ...)

  • x2 may use ts_rf(ts_norm_gminmax(), ...) plus a smoothing filter

  • deterministic auxiliary variables may use ts_deterministic(), ts_periodic(), or ts_persist()

In other words, the multivariate layer coordinates the pipelines, but the behavior of each variable still lives inside its own object.

Value

A ts_mv_spec object.

Examples

spec_y <- ts_mv_spec(ts_mlp(ts_norm_gminmax()), variables = c("y", "x1"))
spec_x1 <- ts_mv_spec(ts_deterministic("periodic", period = 7), variables = "x1")

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