Learn R Programming

mafs (version 0.0.3)

select_forecast: Selects best forecast model

Description

select_forecast is the main function of this package. It uses apply_all_models() and other internal functions of this package to generate generate multiple forecasts for the same time series object.

Usage

select_forecast(x, test_size, horizon, error, dont_apply = "",
  verbose = FALSE)

Arguments

x

A ts object.

test_size

The desired length of the test set object to be used to measure the accuracy of the forecast models.

horizon

The forecast horizon length

error

The accuracy metric to be used to select the best forecast model from apply_all_models(). See error_metrics() for the available metrics.

dont_apply

Character vector. Choose one or more models that will not be used on select_forecast().

verbose

logical. Set TRUE if you want mafs to tell you what models are running.

Value

A list of three objects:

df_models

A data.frame with the accuracy metrics of all models applied to x

best_forecast

A forecast object created by applying the best forecast method to x

df_comparison

A dataframe showing both the forecasted and the observed test set

Details

TODO

Examples

Run this code
# NOT RUN {
select_forecast(austres, 6, 12, "MAPE")
# }

Run the code above in your browser using DataLab