varf: Vector Autoregressive model (adapted from vars::VAR)

View source: R/VAR.R

varfR Documentation

Vector Autoregressive model (adapted from vars::VAR)

Description

Vector Autoregressive model adapted from vars::VAR (only for benchmarking)

Usage

varf(
  y,
  h = 5,
  level = 95,
  lags = 1,
  type_VAR = c("const", "trend", "both", "none"),
  ...
)

Arguments

y

A multivariate time series of class ts

h

Forecasting horizon

level

Confidence level for prediction intervals

lags

Number of lags

type_VAR

Type of deterministic regressors to include.

...

Additional parameters to be passed to vars::VAR.

Value

An object of class "mtsforecast"; a list containing the following elements:

method

The name of the forecasting method as a character string

mean

Point forecasts for the time series

lower

Lower bound for prediction interval

upper

Upper bound for prediction interval

x

The original time series

residuals

Residuals from the fitted model

Author(s)

T. Moudiki

References

Bernhard Pfaff (2008). VAR, SVAR and SVEC Models: Implementation Within R Package vars. Journal of Statistical Software 27(4). URL http://www.jstatsoft.org/v27/i04/.

Pfaff, B. (2008) Analysis of Integrated and Cointegrated Time Series with R. Second Edition. Springer, New York. ISBN 0-387-27960-1

Examples


require(fpp)

print(varf(fpp::insurance, lags=2, h=10))

res <- varf(fpp::usconsumption, h=20, lags=2)

par(mfrow=c(1, 2))
plot(res, "consumption")
plot(res, "income")


Techtonique/ahead documentation built on Nov. 24, 2024, 10:33 a.m.