Forecating a VAR object of class ‘varest
’ or of class
‘vec2var
’ with confidence bands.
# S3 method for varest
predict(object, ..., n.ahead = 10, ci = 0.95, dumvar = NULL)
# S3 method for vec2var
predict(object, ..., n.ahead = 10, ci = 0.95, dumvar = NULL)
An object of class ‘varest
’; generated by
VAR()
, or an object of class ‘vec2var
’;
generated by vec2var()
.
An integer specifying the number of forecast steps.
The forecast confidence interval
Matrix for objects of class ‘vec2var
’ or
‘varest
’, if the dumvar
argument in
ca.jo()
has been used or if the exogen
argument in
VAR()
has been used, respectively. The matrix should have
the same column dimension as in the call to ca.jo()
or to
VAR()
and row dimension equal to n.ahead
.
Currently not used.
A list with class attribute ‘varprd
’ holding the
following elements:
A list of matrices per endogenous variable containing the forecasted values with lower and upper bounds as well as the confidence interval.
Matrix of the in-sample endogenous variables.
The estimated VAR object
.
If applicable provided values of exogenous variables,
otherwise NULL
.
The n.ahead
forecasts are computed recursively for the
estimated VAR, beginning with \(h = 1, 2, \ldots, n.ahead\):
$$ \bold{y}_{T+1 | T} = A_1 \bold{y}_T + \ldots + A_p \bold{y}_{T+1-p} + C D_{T+1} $$
The variance-covariance matrix of the forecast errors is a function of \(\Sigma_u\) and \(\Phi_s\).
Hamilton, J. (1994), Time Series Analysis, Princeton University Press, Princeton.
L<U+34AE5C2F>hl, H. (2006), New Introduction to Multiple Time Series Analysis, Springer, New York.
# NOT RUN {
data(Canada)
var.2c <- VAR(Canada, p = 2, type = "const")
predict(var.2c, n.ahead = 8, ci = 0.95)
# }
Run the code above in your browser using DataLab