long_term_lm | R Documentation |
This function predicts the long-term load data based on the provided time series and a set of macroeconomic variables.
long_term_lm(
longterm_and_macro_data,
test_set_steps = 2,
testquant = 500,
rdm_seed = sample(1:10000, 1),
data_directory = tempdir(),
verbose = FALSE
)
longterm_and_macro_data |
Dataframe. Containing the load data and macroeconomic indicators derived from |
test_set_steps |
Integer. Number of time periods in the test set. |
testquant |
Integer. Determines how many of the best ranked models are evaluated with cross validation. |
rdm_seed |
A random seed to keep results consistent |
data_directory |
The path to the directory where the data, plots, and models will be saved. The default is set to a temporary directory. |
verbose |
A boolean value indicating if you want the generated plots to be shown (set to TRUE if yes). |
The model corresponds to
\bar{D}_L(t_L)=\beta_{L,1}+\beta_{L,2}x_1(t_L)+...+ \beta_{L,10}x_{10}(t_L) \epsilon_L(t_L).
where the covariates correspond to the loaded macroeconomic variables from get_macro_economic_data
. The three best models out of all possible covariate combinations are chosen and saved. The predicted and actual time series of the three best models are plotted and saved as well.
A list with the dataframe with the input data and results. A list with the plotted results of the three best models. And a list with the three best models. The dataset, plots, and the models are saved in the respective folder for the country.
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.
A list with the respective plots for each model.
A list with the three best models.
See also function mid_term_lm
and short_term_lm
for the other prediction models and get_macro_economic_data
for the covariate download.
example_longterm_predictions <- long_term_lm(example_longterm_and_macro_data,
test_set_steps = 2, testquant = 500, rdm_seed = 421
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.