predict: Predict method for objects of class varest and vec2var

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Forecating a VAR object of class ‘varest’ or of class ‘vec2var’ with confidence bands.

Usage

1
2
3
4
## S3 method for class 'varest'
predict(object, ..., n.ahead = 10, ci = 0.95, dumvar = NULL)
## S3 method for class 'vec2var'
predict(object, ..., n.ahead = 10, ci = 0.95, dumvar = NULL)

Arguments

object

An object of class ‘varest’; generated by VAR(), or an object of class ‘vec2var’; generated by vec2var().

n.ahead

An integer specifying the number of forecast steps.

ci

The forecast confidence interval

dumvar

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.

Details

The n.ahead forecasts are computed recursively for the estimated VAR, beginning with h = 1, 2, …, n.ahead:

\bold{y}_{T+1 | T} = A_1 \bold{y}_T + … + A_p \bold{y}_{T+1-p} + C D_{T+1}

The variance-covariance matrix of the forecast errors is a function of Σ_u and Φ_s.

Value

A list with class attribute ‘varprd’ holding the following elements:

fcst

A list of matrices per endogenous variable containing the forecasted values with lower and upper bounds as well as the confidence interval.

endog

Matrix of the in-sample endogenous variables.

model

The estimated VAR object.

exo.fcst

If applicable provided values of exogenous variables, otherwise NULL.

Author(s)

Bernhard Pfaff

References

Hamilton, J. (1994), Time Series Analysis, Princeton University Press, Princeton.

Lütkepohl, H. (2006), New Introduction to Multiple Time Series Analysis, Springer, New York.

See Also

VAR, vec2var, plot, fanchart

Examples

1
2
3
data(Canada)
var.2c <- VAR(Canada, p = 2, type = "const")
predict(var.2c, n.ahead = 8, ci = 0.95) 

Example output

Loading required package: MASS
Loading required package: strucchange
Loading required package: zoo

Attaching package: 'zoo'

The following objects are masked from 'package:base':

    as.Date, as.Date.numeric

Loading required package: sandwich
Loading required package: urca
Loading required package: lmtest
$e
         fcst    lower    upper        CI
[1,] 962.6557 961.9446 963.3668 0.7111044
[2,] 963.6538 962.3422 964.9654 1.3116050
[3,] 964.6932 962.8261 966.5603 1.8670903
[4,] 965.6882 963.3092 968.0671 2.3789396
[5,] 966.5814 963.7240 969.4387 2.8573301
[6,] 967.3460 964.0344 970.6576 3.3116112
[7,] 967.9769 964.2302 971.7236 3.7467269
[8,] 968.4827 964.3193 972.6461 4.1633974

$prod
         fcst    lower    upper       CI
[1,] 417.2623 415.9835 418.5411 1.278808
[2,] 417.7410 415.7854 419.6965 1.955532
[3,] 418.2196 415.7674 420.6717 2.452134
[4,] 418.5639 415.6897 421.4380 2.874136
[5,] 418.7644 415.5065 422.0224 3.257935
[6,] 418.8374 415.2253 422.4494 3.612043
[7,] 418.8097 414.8748 422.7446 3.934890
[8,] 418.7110 414.4881 422.9340 4.222973

$rw
         fcst    lower    upper       CI
[1,] 470.2954 468.7660 471.8247 1.529348
[2,] 470.8948 468.8195 472.9701 2.075289
[3,] 471.5360 469.0592 474.0128 2.476757
[4,] 472.2490 469.4525 475.0456 2.796577
[5,] 473.0652 469.9976 476.1329 3.067654
[6,] 473.9943 470.6851 477.3035 3.309184
[7,] 475.0275 471.4966 478.5584 3.530898
[8,] 476.1454 472.4082 479.8825 3.737164

$U
         fcst    lower    upper        CI
[1,] 6.428832 5.880708 6.976957 0.5481244
[2,] 5.903919 5.017510 6.790327 0.8864083
[3,] 5.396177 4.219319 6.573035 1.1768580
[4,] 4.949219 3.518061 6.380377 1.4311576
[5,] 4.595008 2.932516 6.257500 1.6624923
[6,] 4.343933 2.463420 6.224445 1.8805126
[7,] 4.191928 2.102592 6.281265 2.0893366
[8,] 4.126745 1.837864 6.415625 2.2888805

vars documentation built on May 1, 2019, 8:23 p.m.