Description Usage Arguments Value
View source: R/utils-forecasting.R
This function performs hindcasting over a specified segment of
the time series. The hindcasting is intended to simulate the use of a
forecasting method in practice. For a given time series of length m
,
suppose that the last n
points are used for forecast evaluation, then
the procedure is:
fit the model to the first m - n
time points
make a 1-step ahead forecast
add the next observation to the training data, refit the model, and make another forecast
repeat for the n
forecasts
The value of n
is determined in one of several ways, depending on the
hindcast_selection
argument:
last_n
make hindcasts for the last last_n
points of the time
series
pred_frac
make hindcasts for the last pred_frac
fraction of
the time series
pred_start
make hindcasts starting with the pred_start
point
of the time series
1 2 |
fun |
a function for doing the forecasting. It should have arguments:
and should return a data.frame with at least the predicted forecast (in
a column named |
timeseries |
the time series to forecast |
hindcast_method |
the method for determining # of hindcasts |
pred_frac |
the fraction of points at the end of the time series to forecast |
last_n |
the number of points at the end of the time series to forecast |
pred_start |
the index of the point of the time series at which to begin forecasts |
... |
arguments to pass to |
a data.frame of the observed and predicted values, with any other
remaining values returned by fun
. If any error occurs, then NA values for
the observed and predicted
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.