Description Usage Arguments Details References Examples
View source: R/rolling_origin.R
Rolling origin forecast evaluation, a.k.a. time-series cross validation, of a model or method. Computes errors and prediction of a forecast function applied to a time series according to the rolling origin scheme.
1 | rolling_origin_eval(series, start, forecast_fn, h = 1, ...)
|
series |
Univariate time series used for fitting and computing forecast errors. |
start |
Time point used as the starting point for the rolling origin forecast. |
forecast_fn |
Function which returns forecasts. Takes a time series as its first argument and has an argument h representing the forecast horizon. Returns a vector of length equal to the given forecast horizon h. |
h |
Forecast horizon. This function will evaluate all horizons 1 to h. |
... |
Additional arguments passed to forecast_fn |
This method implements the rolling origin forecast evaluation (see e.g. Hyndman and Athanasopoulos, 2018). Returns a list of two matrices (multivariate time series), one containing the errors and one the predictions, where columns represent forecast horizon and rows represent time points.
The method starts with a subset X[1:t] and forecasts X[(t+1):(t+h)] based on this subset. Then forecasts X[(t+2):(t+h+1)] based on X[1:(t+1)] and so on.
Hyndman, R.J., & Athanasopoulos, G. (2018) Forecasting: principles and practice, 2nd edition, OTexts: Melbourne, Australia. OTexts.com/fpp2. Accessed on 2019-10-18
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.