Learn R Programming

iForecast (version 1.1.1)

iForecast.var: Produce multistep forecasts from machine learning VAR

Description

It generates multistep forecasts of machine learning VAR.

Usage

iForecast.var(object, n.ahead)

Arguments

object

The object generated by tts.var.

n.ahead

The number of out-of-sample forecasting periods. If n.ahead=1, it is one-step forecast; if n.ahead>1, it computes multistep forecasts by recursive method.

Author

Ho Tsung-wu <tsungwu@ntnu.edu.tw>, College of Management, National Taiwan Normal University.

Details

This function generates multistep forecasts of machine learning VAR.

Examples

Run this code
data(macrodata)
y=timeSeries::as.timeSeries(macrodata[,-1])
VLD=window(y,start="2019-01-01",end=end(y))
#OUT1=tts.var(data=y,
#             p=3,
#             method="enet",
#             train.end="2018-12-01",
#             type=c("none","trend","season","both")[1])

#fcst_ml=iForecast.var(OUT1, n.ahead=nrow(VLD))

Run the code above in your browser using DataLab