predict.tspred {TSPred} | R Documentation |
Predict method for tspred
objects
Description
Obtains predictions for the time series data contained in a tspred
class object
based on a particular trained model and a prediction method. The model training and prediction method is defined
by a modeling
object contained in the tspred
class object.
Usage
## S3 method for class 'tspred'
predict(object, onestep = obj$one_step, ...)
Arguments
object |
An object of class |
onestep |
Should the function produce one-step ahead predictions?
If |
... |
Other parameters passed to the method |
Details
The function predict.tspred
calls the method predict
on the modeling
objects for each trained model and time series contained in object
.
Finally, the produced time series predictions are introduced in the structure of the
tspred
class object in object
.
Value
An object of class tspred
with updated structure containing
the produced time series predictions.
Author(s)
Rebecca Pontes Salles
See Also
[tspred()] for defining a particular time series prediction process, and [ARIMA()] for defining a time series modeling and prediction method.
Other predict:
predict()
Examples
data(CATS)
#Obtaining objects of the processing class
proc1 <- subsetting(test_len=20)
proc2 <- BoxCoxT(lambda=NULL)
proc3 <- WT(level=1, filter="bl14")
#Obtaining objects of the modeling class
modl1 <- ARIMA()
#Obtaining objects of the evaluating class
eval1 <- MSE_eval()
#Defining a time series prediction process
tspred_1 <- tspred(subsetting=proc1,
processing=list(BCT=proc2,
WT=proc3),
modeling=modl1,
evaluating=list(MSE=eval1)
)
summary(tspred_1)
tspred_1 <- subset(tspred_1, data=CATS[3])
tspred_1 <- preprocess(tspred_1,prep_test=FALSE)
tspred_1 <- train(tspred_1)
tspred_1 <- predict(tspred_1, onestep=TRUE)