Skip to contents

Sometimes your validation or testing data has more values than the horizon of your model but you still want to create predictions for each time step on them. rolling_slice only generates the slices and can be useful for debuging purposes.

Usage

rolling_predict(object, past_data, new_data, step = NULL)

rolling_slice(object, past_data, new_data, step = NULL)

Arguments

object

a model object for which prediction is desired.

past_data

A data.frame() with past information for creating the predictions. It should include at least lookback values - but can be more. It's concatenated with new_data before passing forward. If NULL, the data used to train the model is used.

new_data

A data.frame() containing a dataset to generate predictions for. In general it's used to pass static and known information to generate forecasts.

step

Default is the step to be the same as the horizon o the model, that way we have one prediction per slice.

Details

This function will combine your past_data (that can also include your training data) and create slices so you create predictions for each value in new_data.

Functions

  • rolling_slice: Generate slices for predictions without adding the predictions.