modeling function

Time series modeling and prediction

Time series modeling and prediction

Constructor for the modeling class representing a time series modeling and prediction method based on a particular model. The modeling class has two specialized subclasses linear and MLM reagarding linear models and machine learning based models, respectively.

modeling( train_func, train_par = NULL, pred_func = NULL, pred_par = NULL, ..., subclass = NULL ) MLM( train_func, train_par = NULL, pred_func = NULL, pred_par = NULL, sw = NULL, proc = NULL, ..., subclass = NULL ) linear( train_func, train_par = NULL, pred_func = NULL, pred_par = NULL, ..., subclass = NULL )

Arguments

  • train_func: A function for training a particular model.
  • train_par: List of named parameters required by train_func.
  • pred_func: A function for prediction based on the model trained by train_func.
  • pred_par: List of named parameters required by pred_func.
  • ...: Other parameters to be encapsulated in the class object.
  • subclass: Name of new specialized subclass object created in case it is provided.
  • sw: A SW object regarding sliding windows processing. Optional.
  • proc: A list of processing objects regarding any pre(post)processing needed during training or prediction. Optional.

Returns

An object of class modeling.

Examples

forecast_mean <- function(...){ do.call(forecast::forecast,c(list(...)))$mean } l <- linear(train_func = forecast::auto.arima, pred_func = forecast_mean, method="ARIMA model", subclass="ARIMA") summary(l) m <- MLM(train_func = nnet::nnet, train_par=list(size=5), pred_func = predict, sw=SW(window_len = 6), proc=list(MM=MinMax()), method="Artificial Neural Network model", subclass="NNET") summary(m)

See Also

Other constructors: ARIMA(), LT(), MSE_eval(), evaluating(), processing(), tspred()

Author(s)

Rebecca Pontes Salles

  • Maintainer: Rebecca Pontes Salles
  • License: GPL (>= 2)
  • Last published: 2021-01-21