varf | R Documentation |
Vector Autoregressive model adapted from vars::VAR (only for benchmarking)
varf(
y,
h = 5,
level = 95,
lags = 1,
type_VAR = c("const", "trend", "both", "none"),
...
)
y |
A multivariate time series of class |
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. |
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 |
T. Moudiki
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
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.