Description Usage Arguments Value Examples
View source: R/HELPER_add_fc_values_per_split_date.R
add_fc_values_per_split_date
is a function that adds previously
computed hierarchical forecasts into the main forecasting table, for a single
split date.
1 2 3 4 | add_fc_values_per_split_date(
main_forecasting_table,
grouped_hierarchical_fc_values
)
|
main_forecasting_table |
A tibble object that contains run forecasts for
one split date and all groups. It is assumed that this is the output of the
|
grouped_hierarchical_fc_values |
A tibble that containts the best
fc_model for each group. It is assumed that this tibble is created using
the |
A tibble with the consistent hierarchical forecast value for all groups in all forecast dates, at the specified forecast split date
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | main_forecasting_table <- dummy_hierarchical_gasprice %>%
dplyr::filter(oil_company == "CompanyA") %>%
tstools::initialize_ts_forecast_data(
date_col = "year_month",
col_of_interest = "gasprice",
group_cols = "currency",
hierarchical_cols = c("location")
) %>%
dplyr::filter(period >= as.Date("2004-06-30")) %>%
create_main_forecasting_table() %>%
dplyr::filter(ts_split_date == 200605) %>%
add_fc_models_to_main_forecasting_table(
fc_methods = c("basic", "linear")
)
best_model_per_group <- main_forecasting_table %>%
get_forecast_accuracy_overview() %>%
get_best_forecast_methods()
grouped_hierarchical_fc_values <- get_consistent_fc_values(
main_forecasting_table = main_forecasting_table,
best_model_per_group = best_model_per_group
)
add_fc_values_per_split_date(
main_forecasting_table = main_forecasting_table,
grouped_hierarchical_fc_values = grouped_hierarchical_fc_values
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.