long_term_future: Long-term trend predictions for future years

View source: R/long_term_future.R

long_term_futureR Documentation

Long-term trend predictions for future years

Description

This function extends the long-term trend predictions generated by long_term_lm until a specified future year. The unknown macro-economic covariates are either obtained from the WEO Outlook with long_term_future_data or can be supplied manually. The function also produces and saves visualizations of the actual and the predicted demand over the training, test, and future periods.

Usage

long_term_future(
  longterm_future_macro_data,
  data_directory = tempdir(),
  model_list = NULL,
  verbose = FALSE
)

Arguments

longterm_future_macro_data

Dataframe. Generated by long_term_future_data

data_directory

The path to the directory where the data will be saved and where the function will look for the long-term models from long_term_lm. The default is set to a temporary directory.

model_list

A list with the models from long_term_lm. Only needs to be specified if the models are not in the data directory.

verbose

A boolean value indicating if you want the generated plots to be shown (set to TRUE if yes).

Value

A list with the extended initial dataframe with the future predictions for each of the 3 best long term models and one plot with the respective results per model.

longterm_future_predictions

A dataframe with the input data and additional columns for test_set_steps and for best three models longterm_model_predictions1, longterm_model_predictions2 and longterm_model_predictions3.

logterm_future_plots

A list with the respective plots for each model.

See Also

See also function mid_term_future and short_term_future for the other prediction models and long_term_future_data for the covariate download.

Examples

example_longterm_future_predictions <- long_term_future(example_longterm_future_macro_data)

oRaklE documentation built on June 8, 2025, 12:41 p.m.