compare_forecasts_performance: Create plot to compare forecast performance

Description Usage Arguments Value Examples

View source: R/VISUALIZE_compare_forecasts_performance.R

Description

compare_forecasts_performance is a function to create a plot which displays the forecast performance of one or more forecast models, based on a selected performance summary variable. For demo purposes, sensitive figures can be hidden from the audience.

Usage

1
2
3
4
5
compare_forecasts_performance(
  accuracy_overview,
  fc_models = c(),
  demo_mode = FALSE
)

Arguments

accuracy_overview

A tibble containing an overview of the overall forecast accuracy of each forecast model in the main_forecasting_table, limited to data for a single group.

fc_models

A character vector specifying which forecast models to display.

demo_mode

Boolean, which is to be set to TRUE if any potentially sensitive figures should be hidden from the audience for demo purposes, or set to FALSE if all figures can safely be displayed.

Value

A plotly object displaying performance per forecast model.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
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() %>%
   head(10) %>%
   add_fc_models_to_main_forecasting_table(
      periods_ahead = 12,
      fc_methods = c("linear")
   ) %>%
   get_forecast_accuracy_overview()
compare_forecasts_performance(
   accuracy_overview = accuracy_overview,
   fc_models = c("fc_linear_trend", "fc_linear_trend_seasonal")
)

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