add_hierarchical_fc_models_to_main_forecasting_table: Add hierarchical forecast values to main forecasting table

Description Usage Arguments Value Examples

View source: R/POST_FORECAST_add_hierarchical_fc_models_to_main_forecasting_table.R

Description

add_hierarchical_fc_models_to_main_forecasting_table is a wrapper function, that combines previously computed forecasts according to their hierarchy and adds them to the main forecasting table.

Usage

1

Arguments

main_forecasting_table

A tibble object that contains run forecasts for all split dates and all groups. It is assumed that this is the output of the add_fc_models_to_main_forecasting_table or update_main_forecasting_table function. Data needs to be hierarchical (see example).

Value

The main_forecasting_table (input) with the addition of the consistent and bottom up hierarchical forecast models (within the fc_model column), and their errors (within the fc_errors column.)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
dummy_hierarchical_gasprice %>%
   tstools::initialize_ts_forecast_data(
      date_col = "year_month",
      col_of_interest = "gasprice",
      group_cols = "currency",
      hierarchical_cols = c("location", "oil_company")
   ) %>%
   dplyr::filter(period >= as.Date("2004-10-31")) %>%
   create_main_forecasting_table() %>%
   add_fc_models_to_main_forecasting_table(
      fc_methods = c("basic", "linear")
   ) %>%
   add_hierarchical_fc_models_to_main_forecasting_table()

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