Description Usage Arguments Value Examples
View source: R/INTRA_FORECAST_add_fc_errors_to_main_forecasting_table.R
add_fc_errors_to_main_forecasting_table
is a function to extend the
main forecasting table with an additional column, called fc_errors, which
contains the forecast values, actuals and resulting forecast errors for every
forecast model in the fc_models column. By default, this function is called
within the add_fc_models_to_main_forecasting_table function.
1 2 3 4 | add_fc_errors_to_main_forecasting_table(
main_forecasting_table,
allow_negative_fc = FALSE
)
|
main_forecasting_table |
A tibble containing several columns of data
required for time series forecasting, which has been created using the
|
allow_negative_fc |
Boolean, which is to be set to TRUE if negative forecast values are allowed, or set to FALSE if negative forecast values should be overwritten by a value of zero. |
A tibble containing several columns of data required for time series forecasting, extended with as an additional column, called fc_errors, which contains the forecast values, actuals and resulting forecast errors.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | data <- tstools::initialize_ts_forecast_data(
data = dummy_gasprice,
date_col = "year_month",
col_of_interest = "gasprice",
group_cols = c("state", "oil_company")
)
main_forecasting_table <- create_main_forecasting_table(
data = data,
seasonal_periods = c(12,3)
) %>%
add_fc_models_to_main_forecasting_table(
periods_ahead = 12,
fc_methods = c("basic", "linear"),
add_fc_errors = F
) %>%
add_fc_errors_to_main_forecasting_table()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.