predict: Predict method for 'modeling' objects

Description Usage Arguments Value Author(s) See Also Examples

Description

Obtains time series predictions based on a trained model and a particular prediction function defined in a modeling object.

Usage

1
2
3
4
5
## 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 modeling defining a particular model.

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 pred_func of object.

onestep

Should the function produce one-step ahead predictions? If FALSE, a multi-step ahead prediction approach is adopted.

For predict.MLM, sw of object may be used to transform the time series input in data into sliding windows used during prediction. Also, proc of object may be used to preprocess/postprocess the input during prediction.

Value

A list containing object and the produced predictions.

Author(s)

Rebecca Pontes Salles

See Also

Other predict: predict.tspred()

Examples

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

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