create_train_matrices: Create training data matrix and a training response for given...

Description Usage Arguments Value

View source: R/matrix.R

Description

Create training and data matrix and training response for a set of given aheads. Works for both single ahead values and a vector of ahead values. However, note that this function works different from create_train_and_predict_matrices() for multiple ahead values. If multiple ahead values are supplied, we return a matrix of responses containing all aheads at once.

Usage

1
create_train_matrices(lagged_df, ahead, n_days, train_end_date)

Arguments

lagged_df

Data frame of lagged data as in create_train_and_predict_matrices().

ahead

Number of incidence period units (i.e., epiweeks, days, etc.) ahead to forecast. Can be a single positive integer or a vector of positive integers. Note that for each {a} in ahead, the column response+{a}:{response} should be present in lagged_df.

n_days

Number of days worth of data to pull.

train_end_date

The last date to be included in the training data.

Value

A named list with entries:


dshemetov/modeltools-mirror documentation built on Jan. 7, 2022, 12:23 a.m.