lagged_features: Covariate lagged replication for temporal dependence

View source: R/utils.R

lagged_featuresR Documentation

Covariate lagged replication for temporal dependence

Description

Covariate lagged replication for temporal dependence

Usage

lagged_features(X, max_lag, drop_present = TRUE)

Arguments

X

Covariate matrix.

max_lag

Integer giving the maximum lag (i.e. the number of temporal dependence steps).

drop_present

Whether to drop the "present" features (bool).

Value

Matrix with the original columns replicated, and shifted by 1:max_lag if drop_present==TRUE (default) or by 0:max_lag if drop_present==FALSE.

Examples

lagged_features(matrix(seq(20), ncol=2), max_lag=3, drop_present=TRUE)

EQRN documentation built on April 4, 2025, 12:45 a.m.