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

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]