Description Usage Arguments Details Value Author(s) Examples
View source: R/auto_forecast.R
This function provides an algorithm to compute the best possible forecast from the available set of univariate time series. Additionaly, bootstrap methods are employed to both refine point forecasts and compute confidence intervals.
1 2 |
data |
univariate time series (ts object). |
h |
forecast horizon. |
h_cv |
forecast horizon to compute accuracy by cross-validation. |
window |
length of the rolling window for cross-validation. If NULL, a rolling window will not be used. |
acc |
accuracy measure to determine the best model. Either "MAE" for mean absolute error, "RMSE" for root mean squared error or "dir" for directional. |
n |
number of bootstrap simulations used to compute both mean forecasts (bagging) and confidence intervals. |
level |
confidence level for prediction intervals. |
exclude |
one or more models to exclude from evaluation, eg. "auto.arima" or c("tbats", "nnetar"). |
test |
first observation in the test set. Either a single number or a vector of two integers. If not NULL, overrides cross-validation arguments. |
Available models are: "auto.arima", "tbats", "ets", "nnetar", "hw", "arfima", "holt", "thetaf", "ses", "meanf", "splinef", "StrucTS", "elm". For more details about these models, see the documentation from forecast and nnfor packages.
An object of class list containing the following elements:
fc |
A tibble containing point forecasts and lower/upper limits from the bootstrapped distribution. |
error |
A tibble containing out-of-sample forecast errors. |
acc |
A tibble containing RMSE and MAE values for each model ordered according to the selected criteria. |
dir |
A tibble containing the ordered directional accuracy for each model. |
model |
Character vector with the selected model. |
plot |
A ggplot object with graphical representation of both the point forecasts and confidence intervals. |
J. Renato Leripio
1 2 3 4 5 | ## Not run:
library(rafa)
auto_forecast(USAccDeaths, test = c(1976,12))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.