run_dynamic_regression: Run the dynamic regression model

View source: R/counterfactual_model.R

run_dynamic_regressionR Documentation

Run the dynamic regression model

Description

This function trains a dynamic regression model with fourier transformed temporal features and meteorological variables as external regressors on the specified training dataset and makes predictions on the test dataset in a counterfactual scenario. This is referred to as a dynamic regression model in Forecasting: Principles and Practise, Chapter 10 - Dynamic regression models

Usage

run_dynamic_regression(train, test, params, alpha, calc_shaps)

Arguments

train

Dataframe of train data as returned by the split_data_counterfactual() function.

test

Dataframe of test data as returned by the split_data_counterfactual() function.

params

list of hyperparameters to use in dynamic_regression call. Only uses ntrain to specify the number of data points to use for training. Default is 8760 which results in 1 year of hourly data

alpha

Confidence level of the prediction interval between 0 and 1.

calc_shaps

Boolean value. If TRUE, calculate SHAP values for the method used and format them so they can be visualised with shapviz:sv_importance() and shapviz:sv_dependence(). The SHAP values are generated for a subset (or all, depending on the size of the dataset) of the test data.

Details

Note: Runs the dynamic regression model for individualised use with own data pipeline. Otherwise use run_counterfactual() to call this function.

Value

Data frame of predictions and model


ubair documentation built on April 12, 2025, 2:12 a.m.