Description Usage Arguments Value
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.
1 | create_train_matrices(lagged_df, ahead, n_days, train_end_date)
|
lagged_df |
Data frame of lagged data as in |
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 |
n_days |
Number of days worth of data to pull. |
train_end_date |
The last date to be included in the training data. |
A named list with entries:
train_x
: Matrix of training data whose columns correspond to the
value-{days}:{signal}
columns in lagged_df
. The training data consists of the
latest date with an non-null response, plus all data from the training_window_size
days prior to it.
train_y
: Vector of response data from the response+{ahead}:{response}
column of
lagged_df
corresponding to the rows of train_x
. If multiple ahead
values are provided, then this is a matrix instead.
train_geo_values
: Vector of geo values corresponding to the rows
of train_x
.
train_time_values
: Vector of time values corresponding to the rows
of train_x
.
train_end_date
: Latest time_value
used in the training period.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.