R6 class ModelCompareMultivariate
R6 class ModelCompareMultivariate
new()
Initialize an object to compare several Univatiate Time Series Models
ModelCombine$new( data = NA, var_interest = NA, uni_models = NA, var_models = NA, mlp_models = NA, verbose = 0 )
data
The dataframe containing the time series realizations (data should not contain time index)
var_interest
The output variable of interest (dependent variable)
uni_models
A vector of ModelCompareUnivariate objects
var_models
A vector of ModelCompareMultivariateVAR objects
mlp_models
A vector of ModelCompareNNforCaret objects (only picks the best caret model)
verbose
How much to print during the process (Default = 0)
A new 'ModelCombine' object.
get_data()
Returns the time series realization
ModelCombine$get_data()
The Time Series Realization
get_var_interest()
Returns the dependent variable name
ModelCombine$get_var_interest()
The dependent variable name
get_data_var_interest()
Returns the dependent variable data only
ModelCombine$get_data_var_interest()
The dependent variable data only
set_verbose()
Adjust the verbosity level
ModelCombine$set_verbose(verbose = 0)
verbose
0 = Minimal Printing only (usualy limited to step being performed) 1 = Basic printing of model builds, etc. 2 = Reserved for debugging mode. May slow down the run due to excessive printing, especially when using batches
plot_simple_forecasts()
Plots the simple forecast for each model
ModelCombine$plot_simple_forecasts( lastn = FALSE, newxreg = NA, limits = FALSE, zoom = NA )
lastn
If TRUE, this will plot the forecasts forthe last n.ahead values of the realization (Default: FALSE)
newxreg
The future exogenous variable values to be used for prediction. Applicable to models that require the values of the new exogenous variables to be provided for future forecasts, e.g. nnfor::mlp()
limits
If TRUE, this will also plot the lower and upper limits of the forecasts (Default: FALSE)
zoom
A number indicating how much to zoom into the plot. For example zoom = 50 will only plot the last 50 points of the realization Useful for cases where realizations that are long and n.ahead is small.
plot_batch_forecasts()
Plots the forecasts per batch for all models
ModelCombine$plot_batch_forecasts(only_sliding = TRUE)
only_sliding
If TRUE, this will only plot the batch forecasts for the models that used window ASE calculations
plot_batch_ases()
Plots the ASEs per batch for all models
ModelCombine$plot_batch_ases(only_sliding = TRUE)
only_sliding
If TRUE, this will only plot the ASEs for the models that used window ASE calculations
plot_boxplot_ases()
Plots the boxplot of the ASE values for the models
ModelCombine$plot_boxplot_ases()
statistical_compare()
Statistically compares the ASE values of the models using ANOVA and Tukey Adjustment for multiple comparison
ModelCombine$statistical_compare()
The results of the ANOVA test
get_tabular_metrics()
Gets the metrics and results in tabular format
ModelCombine$get_tabular_metrics(only_sliding = FALSE, ases = TRUE)
only_sliding
If TRUE, this will only get results for models that use a sliding ASE calculation method. (Default: FALSE)
ases
If TRUE returns the ASE values for each batch. If FALSE returns the forecasts, and the lower and upper limits asscoiated with the forecasts
compute_simple_forecasts()
Computes the simple forecasts using all the models
ModelCombine$compute_simple_forecasts(lastn = FALSE, newxreg = NA)
lastn
If TRUE, this will get the forecasts for the last n.ahead values of the realization (Default: FALSE). If there is a ModelCompareNNforCaret object passed to this object, then lastn must be TRUE.
newxreg
The future exogenous variable values to be used for prediction. Applicable to models that require the values of the new exogenous variables to be provided for future forecasts, e.g. nnfor::mlp()
The forecasted values
create_ensemble()
Creates an ensemble model based on all the models provided
ModelCombine$create_ensemble(cuts = NA)
predict_ensemble()
Makes a prediction based on the ensemble model
ModelCombine$predict_ensemble(naive = FALSE, comb = "median", newxreg = NA)
naive
If TRUE, the ensemble will be a simple mean of the prediction of all the models If FALSE, the ensemble will use a glm model created from the batch predictions of all the models
comb
If 'naive' = TRUE, how to combine the predictions. Allowed values are 'mean' or 'median'
newxreg
The future exogenous variable values to be used for prediction. Applicable to models that require the values of the new exogenous variables to be provided for future forecasts, e.g. nnfor::mlp()
The predictions from each model along with the ensemble prediction
clone()
The objects of this class are cloneable with this method.
ModelCombine$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.