Description Usage Arguments Value Examples
View source: R/POST_FORECAST_add_mean_ensemble_fc_methods.R
add_mean_ensemble_fc_methods
is a function to add a new forecast
method after other forecast methods have been added to the
main_forecast_table. It takes the average value of the given forecast methods
as the forecast value.
1 2 3 4 5 | add_mean_ensemble_fc_methods(
main_forecasting_table,
fc_models,
fc_model_name = "fc_mean_ensemble"
)
|
main_forecasting_table |
A tibble containing a single row and several
columns of data required for time series forecasting, which has been
created using the |
fc_models |
A character vector specifying which forecast models to use in the ensemble. |
fc_model_name |
A character string specifying the name of the mean ensamble method that is added to the main_forecasting_table. |
The main_forecasting_table with a mean ensemble method added.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 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(1) %>%
add_fc_models_to_main_forecasting_table(
periods_ahead = 12,
fc_methods = c("linear")
) %>%
add_mean_ensemble_fc_methods(
fc_models = c("fc_linear_trend", "fc_linear_trend_seasonal")
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.