modeling {TSPred} | R Documentation |
Time series modeling and prediction
Description
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.
Usage
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 |
pred_func |
A function for prediction based on the model trained by |
pred_par |
List of named parameters required by |
... |
Other parameters to be encapsulated in the class object. |
subclass |
Name of new specialized subclass object created in case it is provided. |
sw |
A |
proc |
A list of |
Value
An object of class modeling
.
Author(s)
Rebecca Pontes Salles
See Also
Other constructors:
ARIMA()
,
LT()
,
MSE_eval()
,
evaluating()
,
processing()
,
tspred()
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)