Learn R Programming

caretForecast (version 0.1.3)

forecast.ARml: Forecasting using ARml model

Description

Forecasting using ARml model

Usage

# S3 method for ARml
forecast(object, h = frequency(object$y), xreg = NULL, level = c(80, 95), ...)

Value

A list class of forecast containing the following elemets

  • x : The input time series

  • method : The name of the forecasting method as a character string

  • mean : Point forecasts as a time series

  • lower : Lower limits for prediction intervals

  • upper : Upper limits for prediction intervals

  • level : The confidence values associated with the prediction intervals

  • model : A list containing information about the fitted model

  • newxreg : A matrix containing regressors

Arguments

object

An object of class "ARml", the result of a call to ARml.

h

forecast horizon

xreg

Optionally, a numerical vector or matrix of future external regressors

level

Confidence level for prediction intervals.

...

Ignored

Author

Resul Akay

Examples

Run this code

library(caretForecast)

train_data <- window(AirPassengers, end = c(1959, 12))

test <- window(AirPassengers, start = c(1960, 1))

ARml(train_data, caret_method = "lm", max_lag = 12) -> fit

forecast(fit, h = length(test), level = c(80,95)) -> fc

autoplot(fc)+ autolayer(test)

accuracy(fc, test)

Run the code above in your browser using DataLab