get_best_forecast_methods: Get best forecast methods

Description Usage Arguments Value Examples

View source: R/POST_FORECAST_get_best_forecast_methods.R

Description

get_best_forecast_methods is a function to determine the n best forecast methods from an (ordered) accuracy overview, when evaluating for a specific minimum and maximum number of periods ahead forecast horizon. This is determined separately for every grouping available within the accuracy overview.

Usage

1
2
3
4
5
6
7
get_best_forecast_methods(
  accuracy_overview,
  n = 1,
  min_periods_ahead = 1,
  max_periods_ahead = Inf,
  filter_incomplete_fc = TRUE
)

Arguments

accuracy_overview

A tibble containing an overview of the overall forecast accuracy of each forecast model in the main_forecasting_table.

n

A positive integer value indicating the number of best forecast methods to be returned.

min_periods_ahead

A positive integer value indicating the minimum number of periods ahead to be used as forecast horizon for evaluating the forecast performance.

max_periods_ahead

A positive integer value indicating the maximum number of periods ahead to be used as forecast horizon for evaluating the forecast performance.

filter_incomplete_fc

Boolean, which is set to TRUE if all incomplete forecasts (which did run successfully for one or more split dates for a specific group) should be filtered before calculation, or set to FALSE if they should not be filtered.

Value

A tibble with an overview of the n best forecast methods for each grouping.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
accuracy_overview <- tstools::initialize_ts_forecast_data(
      data = dummy_gasprice,
      date_col = "year_month",
      col_of_interest = "gasprice",
      group_cols = c("state", "oil_company")
   ) %>% 
   create_main_forecasting_table(
      seasonal_periods = c(12,3),
      min_train_periods = 150
   ) %>%
   add_fc_models_to_main_forecasting_table(
      periods_ahead = 12,
      fc_methods = c("basic", "linear")
   ) %>%
   get_forecast_accuracy_overview()
get_best_forecast_methods(accuracy_overview)

ing-bank/tsforecast documentation built on Sept. 18, 2020, 9:40 a.m.