forecast.ARml {caretForecast} | R Documentation |
Forecasting using ARml model
Description
Forecasting using ARml model
Usage
## S3 method for class 'ARml'
forecast(object, h = frequency(object$y), xreg = NULL, level = c(80, 95), ...)
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 |
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
Author(s)
Resul Akay
Examples
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)
[Package caretForecast version 0.1.1 Index]