Set up data for explain_forecast
get_data_forecast(
y,
xreg,
train_idx,
explain_idx,
explain_y_lags,
explain_xreg_lags,
horizon
)
A matrix or numeric vector containing the endogenous variables for the model. One variable per column, one observation per row.
A matrix containing exogenous regressors for the model. One variable per column, one observation per row. Should have nrow(data) + horizon rows.
The observations indices in data to use as training examples.
The observations indices in data to explain.
Numeric vector Indicates the number of lags of y to include in the explanation.
Numeric vector Indicates the number of lags of xreg to include in the explanation.
The forecast horizon to explain.
A list containing
The data.frames x_train and x_explain which holds the lagged data examples.
A numeric, n_endo denoting how many columns are endogenous in x_train and x_explain.
A list, group with groupings of each variable to explain per variable and not per variable and lag.