mid_term_future: Generate future mid-term demand predictions

View source: R/mid_term_future.R

mid_term_futureR Documentation

Generate future mid-term demand predictions

Description

This function extends the mid-term demand predictions generated by mid_term_lm until a specified future year. The unknown temperature-based covariates for future days are obtained by averaging over the past 3 years of the dataset. The function also produces and saves visualizations of the actual and the predicted demand over the training, test, and future periods.

Usage

mid_term_future(
  midterm_predictions,
  end_year,
  Tref = 18,
  data_directory = tempdir(),
  midterm_model = NULL,
  verbose = FALSE
)

Arguments

midterm_predictions

Dataframe or list. Generated by mid_term_lm. Either the prediction dataframe or the complete output list can be used. If the full list is supplied the function will extract the necessary models automatically.

end_year

Integer. Specifies the final year for which future predictions will be generated.

Tref

Numeric. Reference temperature as basis for the calculation of cooling and heating days.

data_directory

The path to the directory where the data will be saved and where the function will look for the mid-term model from mid_term_lm. The default is set to a temporary directory.

midterm_model

The mid-term seasonality model from mid_term_lm. Only needs to be specified if the model is not in the data directory.

verbose

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

Value

A list with the extended initial dataframe with the future predictions for the mid term model. And the plot with the midterm seasonality future forecast. The dataset and the plot are saved in the respective folder for the country.

midterm_future_predictions

A dataframe with the input and prediction data for the future mid-term seasonality.

midterm_future_plot

A plot with the prediction results.

See Also

See also function long_term_future and short_term_future for the other prediction models.

Examples

example_midterm_future_predictions <- mid_term_future(example_midterm_predictions,
  end_year = 2028, Tref = 18
)

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