create_X: Create Design Matrix

View source: R/helper.R

create_XR Documentation

Create Design Matrix

Description

A helper function to create a design matrix to be the input for the machine learning models Requires choosing the number of lags in addition to each variable. Potentially later the number of lags could be a vector of length p. That way the number of lags could be different for each variable.

Usage

create_X(data, lags, data_exog = NULL)

Arguments

data

A dataframe or matrix of observations.

lags

The number of lags of each variable to be included in the design matrix, should be a scaler to apply to all variables or a vector with entries for each column.

data_exog

A dataframe or matrix of exogenous observations to be considered in addition to the lagged columns of data.

Value

A design matrix for training/predictions with the machine learning MCUSUM methods.


dpweix/mlmcusum documentation built on July 31, 2023, 10:13 a.m.