| forecast.rbfmvar | R Documentation |
Generates out-of-sample forecasts from an RBFM-VAR model.
## S3 method for class 'rbfmvar'
forecast(object, h = 10, level = 95, ...)
object |
An |
h |
Integer. Forecast horizon (number of periods ahead). Default is 10. |
level |
Numeric. Confidence level for prediction intervals (0-100). Default is 95. |
... |
Additional arguments (currently ignored). |
Forecasts are generated iteratively using the estimated VAR coefficients. Standard errors are computed assuming normally distributed innovations.
Note that since the RBFM-VAR is estimated on second differences, forecasts
are for \Delta^2 y_{t+h}, which need to be accumulated to obtain
level forecasts.
An object of class "rbfmvar_forecast" containing:
Matrix of point forecasts (n x h).
Matrix of forecast standard errors (n x h).
Matrix of lower prediction bounds (n x h).
Matrix of upper prediction bounds (n x h).
Forecast horizon.
Confidence level.
Variable names.
# Simulate VAR data
set.seed(123)
n <- 200
e <- matrix(rnorm(n * 3), n, 3)
y <- matrix(0, n, 3)
colnames(y) <- c("y1", "y2", "y3")
for (t in 3:n) {
y[t, ] <- 0.3 * y[t-1, ] + 0.2 * y[t-2, ] + e[t, ]
}
fit <- rbfmvar(y, lags = 2)
fc <- forecast(fit, h = 10)
print(fc)
plot(fc)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.