predict {TSPred} | R Documentation |
Predict method for modeling
objects
Description
Obtains time series predictions based on a trained model and a particular prediction function
defined in a modeling
object.
Usage
## S3 method for class 'MLM'
predict(object, mdl, data, n.ahead, ..., onestep = TRUE)
## S3 method for class 'linear'
predict(object, mdl, data, n.ahead, ..., onestep = TRUE)
Arguments
object |
An object of class |
mdl |
A time series model object used for prediction. |
data |
A list of time series data input for prediction. |
n.ahead |
Integer defining the number of observations to be predicted. |
... |
Other parameters passed to |
onestep |
Should the function produce one-step ahead predictions?
If For |
Value
A list containing object
and the produced predictions.
Author(s)
Rebecca Pontes Salles
See Also
Other predict:
predict.tspred()
Examples
data(CATS,CATS.cont)
a <- ARIMA()
model <- train(a,list(CATS[,1]))$results[[1]]$res
pred_data <- predict(a,model,data=NULL,n.ahead=20,onestep=FALSE)
n <- NNET(size=5, sw=SW(window_len = 5+1), proc=list(MM=MinMax()))
model <- train(n,list(CATS[,1]))$results[[1]]$res
pred_data <- predict(n,model,data=list(CATS.cont[,1]),n.ahead=20)