modeling: Time series modeling and prediction

Description Usage Arguments Value Author(s) See Also Examples

View source: R/modeling.r

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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.

Value

An object of class modeling.

Author(s)

Rebecca Pontes Salles

See Also

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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)

TSPred documentation built on Jan. 21, 2021, 5:10 p.m.