lag_components: Lag components

View source: R/transformation.R

lag_componentsR Documentation

Lag components

Description

This function shift in time a set of features in order to be used in the training and prediction of the models. It is an important step for the multi-step prediction of autoregressive models, where the estimated output is directly used in the subsequent predictions.

Usage

lag_components(
  data,
  maxLag,
  featuresNames = NULL,
  predictionStep = NULL,
  forceGlobalInputFeatures = NULL,
  forceInitInputFeatures = NULL,
  forceInitOutputFeatures = NULL,
  fillInitNAs = F
)

Arguments

data

<data.frame> containing the multiple series to transform. All the series that are not declared in featuresNames are bypassed to the output

maxLag

<integer> describing the maximum lags to be considered. One feature will be generated for each lag.

featuresNames

<array> selecting the series names to transform (names of the columns in data).

predictionStep

optional, <integer> informing of the timestep considered in the prediction. Only used in prediction mode, when training it doesn't need to be described

forceGlobalInputFeatures

<list> of values to be considered instead of the original values defined in data.

forceInitInputFeatures

<list> of the initial values to consider before the first value defined in data.

forceInitOutputFeatures

<list> of the initial values to consider before the first value defined in data.

fillInitNAs

<boolean> indicating if the unknown lags should be filled with their last known value.

Value

<data.frame> containing the same initial information of the data input argument, plus the lagged components as new columns.


biggproject/biggr documentation built on Oct. 2, 2024, 11:13 p.m.