





































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






































This is page 383 Printer: Opaque this
The vector autoregression (VAR) model is one of the most successful, flexi- ble, and easy to use models for the analysis of multivariate time series. It is a natural extension of the univariate autoregressive model to dynamic mul- tivariate time series. The VAR model has proven to be especially useful for describing the dynamic behavior of economic and financial time series and for forecasting. It often provides superior forecasts to those from univari- ate time series models and elaborate theory-based simultaneous equations models. Forecasts from VAR models are quite flexible because they can be made conditional on the potential future paths of specified variables in the model. In addition to data description and forecasting, the VAR model is also used for structural inference and policy analysis. In structural analysis, cer- tain assumptions about the causal structure of the data under investiga- tion are imposed, and the resulting causal impacts of unexpected shocks or innovations to specified variables on the variables in the model are summa- rized. These causal impacts are usually summarized with impulse response functions and forecast error variance decompositions. This chapter focuses on the analysis of covariance stationary multivari- ate time series using VAR models. The following chapter describes the analysis of nonstationary multivariate time series using VAR models that incorporate cointegration relationships.
384 11. Vector Autoregressive Models for Multivariate Time Series
This chapter is organized as follows. Section 11.2 describes specification, estimation and inference in VAR models and introduces the S+FinMetrics function VAR. Section 11.3 covers forecasting from VAR model. The discus- sion covers traditional forecasting algorithms as well as simulation-based forecasting algorithms that can impose certain types of conditioning infor- mation. Section 11.4 summarizes the types of structural analysis typically performed using VAR models. These analyses include Granger-causality tests, the computation of impulse response functions, and forecast error variance decompositions. Section 11.5 gives an extended example of VAR modeling. The chapter concludes with a brief discussion of Bayesian VAR models. This chapter provides a relatively non-technical survey of VAR models. VAR models in economics were made popular by Sims (1980). The definitive technical reference for VAR models is L¨utkepohl (1991), and updated sur- veys of VAR techniques are given in Watson (1994) and L¨utkepohl (1999) and Waggoner and Zha (1999). Applications of VAR models to financial data are given in Hamilton (1994), Campbell, Lo and MacKinlay (1997), Cuthbertson (1996), Mills (1999) and Tsay (2001).
Let Yt = (y 1 t, y 2 t,... , ynt)^0 denote an (n×1) vector of time series variables. The basic p-lag vector autoregressive (VAR(p)) model has the form
Yt= c + Π 1 Yt− 1 +Π 2 Yt− 2 + · · · + ΠpYt−p + εt, t = 1,... , T (11.1)
where Πi are (n × n) coefficient matrices and εt is an (n × 1) unobservable zero mean white noise vector process (serially uncorrelated or independent) with time invariant covariance matrix Σ. For example, a bivariate VAR(2) model equation by equation has the form μ y 1 t y 2 t
μ c 1 c 2
μ π^111 π^112 π^121 π^122
¶ μ y 1 t− 1 y 2 t− 1
μ π^211 π^212 π^221 π^222
¶ μ y 1 t− 2 y 2 t− 2
μ ε 1 t ε 2 t
or
y 1 t = c 1 + π^111 y 1 t− 1 + π^112 y 2 t− 1 + π^211 y 1 t− 2 + π^212 y 2 t− 2 + ε 1 t y 2 t = c 2 + π^121 y 1 t− 1 + π^122 y 2 t− 1 + π^221 y 1 t− 1 + π^222 y 2 t− 1 + ε 2 t
where cov(ε 1 t, ε 2 s) = σ 12 for t = s; 0 otherwise. Notice that each equation has the same regressors — lagged values of y 1 t and y 2 t. Hence, the VAR(p) model is just a seemingly unrelated regression (SUR) model with lagged variables and deterministic terms as common regressors.
386 11. Vector Autoregressive Models for Multivariate Time Series
with
μ
, c =
μ − 0. 7
, μ =
μ 1 5
μ 1 0. 5
and normally distributed errors are
pi1 = matrix(c(0.7,0.2,0.2,0.7),2,2) mu.vec = c(1,5) c.vec = as.vector((diag(2)-pi1)%*%mu.vec) cov.mat = matrix(c(1,0.5,0.5,1),2,2) var1.mod = list(const=c.vec,ar=pi1,Sigma=cov.mat) set.seed(301) y.var = simulate.VAR(var1.mod,n=250,
dimnames(y.var) = list(NULL,c("y1","y2"))
The simulated data are shown in Figure 11.1. The VAR is stationary since the eigenvalues of Π 1 are less than one:
eigen(pi1,only.values=T) $values: [1] 0.9 0.
$vectors: NULL
Notice that the intercept values are quite different from the mean values of y 1 and y 2 :
c.vec [1] -0.7 1. colMeans(y.var) y1 y 0.8037 4.
Consider the basic VAR(p) model (11.1). Assume that the VAR(p) model is covariance stationary, and there are no restrictions on the parameters of the model. In SUR notation, each equation in the VAR(p) may be written as yi = Zπi + ei, i = 1,... , n
where yi is a (T × 1) vector of observations on the ith^ equation, Z is a (T × k) matrix with tth^ row given by Z^0 t = (1, Y^0 t− 1 ,... , Y t^0 −p), k = np + 1, πi is a (k × 1) vector of parameters and ei is a (T × 1) error with covariance matrix σ^2 i IT. Since the VAR(p) is in the form of a SUR model
11.2 The Stationary Vector Autoregression Model 387
time
y1,y
0 50 100 150 200 250
-^ -^
0
2
4
6
8
10 y y
FIGURE 11.1. Simulated stationary VAR(1) model.
where each equation has the same explanatory variables, each equation may be estimated separately by ordinary least squares without losing efficiency relative to generalized least squares. Let Πˆ = [ˆπ 1 ,... , ˆπn] denote the (k×n) matrix of least squares coefficients for the n equations. Let vec( Πˆ) denote the operator that stacks the columns of the (n × k) matrix Πˆ into a long (nk × 1) vector. That is,
vec( Πˆ) =
π ˆ 1 .. . π ˆn
Under standard assumptions regarding the behavior of stationary and er- godic VAR models (see Hamilton (1994) or L¨utkepohl (1991)) vec( Πˆ) is consistent and asymptotically normally distributed with asymptotic covari- ance matrix avar [(vec(Π ˆ)) = Σˆ ⊗ (Z
0 Z)−^1
where
Σ^ ˆ = 1 T − k
t=
ˆεtˆε^0 t
and ˆεt = Yt− Πˆ
0 Zt is the multivariate least squares residual from (11.1) at time t.
11.2 The Stationary Vector Autoregression Model 389
for which there are print, summary, plot and predict methods as well as extractor functions coefficients, residuals, fitted and vcov. The calling syntax of VAR is a bit complicated because it is designed to handle multivariate data in matrices, data frames as well as “timeSeries” objects. The use of VAR is illustrated with the following example.
Example 65 Bivariate VAR model for exchange rates
This example considers a bivariate VAR model for Yt = (∆st, f pt)^0 , where st is the logarithm of the monthly spot exchange rate between the US and Canada, f pt = ft − st = iU St − iCAt is the forward premium or interest rate differential, and ft is the natural logarithm of the 30-day forward exchange rate. The data over the 20 year period March 1976 through June 1996 is in the S+FinMetrics “timeSeries” lexrates.dat. The data for the VAR model are computed as
dspot = diff(lexrates.dat[,"USCNS"]) fp = lexrates.dat[,"USCNF"]-lexrates.dat[,"USCNS"] uscn.ts = seriesMerge(dspot,fp) colIds(uscn.ts) = c("dspot","fp") uscn.ts@title = "US/CN Exchange Rate Data" par(mfrow=c(2,1)) plot(uscn.ts[,"dspot"],main="1st difference of US/CA spot
plot(uscn.ts[,"fp"],main="US/CN interest rate
Figure 11.2 illustrates the monthly return ∆st and the forward premium f pt over the period March 1976 through June 1996. Both series appear to be I(0) (which can be confirmed using the S+FinMetrics functions unitroot or stationaryTest) with ∆st much more volatile than f pt. f pt also ap- pears to be heteroskedastic.
Specifying and Estimating the VAR(p) Model
To estimate a VAR(1) model for Yt use
var1.fit = VAR(cbind(dspot,fp)~ar(1),data=uscn.ts)
Note that the VAR model is specified using an S-PLUS formula, with the multivariate response on the left hand side of the ~ operator and the built- in AR term specifying the lag length of the model on the right hand side. The optional data argument accepts a data frame or “timeSeries” ob- ject with variable names matching those used in specifying the formula. If the data are in a “timeSeries” object or in an unattached data frame (“timeSeries” objects cannot be attached) then the data argument must be used. If the data are in a matrix then the data argument may be omit- ted. For example,
390 11. Vector Autoregressive Models for Multivariate Time Series
1st difference of US/CN spot exchange rate
1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996
-0.
-0.
US/CN interest rate differential
-0.005 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996
-0.
FIGURE 11.2. US/CN forward premium and spot rate.
uscn.mat = as.matrix(seriesData(uscn.ts)) var2.fit = VAR(uscn.mat~ar(1))
If the data are in a “timeSeries” object then the start and end options may be used to specify the estimation sample. For example, to estimate the VAR(1) over the sub-period January 1980 through January 1990
var3.fit = VAR(cbind(dspot,fp)~ar(1), data=uscn.ts,
may be used. The use of in.format=%m %Y" sets the format for the date strings specified in the start and end options to match the input format of the dates in the positions slot of uscn.ts. The VAR model may be estimated with the lag length p determined using a specified information criterion. For example, to estimate the VAR for the exchange rate data with p set by minimizing the BIC with a maximum lag pmax = 4 use
var4.fit = VAR(uscn.ts,max.ar=4, criterion="BIC") var4.fit$info ar(1) ar(2) ar(3) ar(4) BIC -4028 -4013 -3994 -
When a formula is not specified and only a data frame, “timeSeries” or matrix is supplied that contains the variables for the VAR model, VAR fits
392 11. Vector Autoregressive Models for Multivariate Time Series
The first column under the label “Coefficients:” gives the estimated coefficients for the ∆st equation, and the second column gives the estimated coefficients for the f pt equation:
∆st = − 0. 0036 − 0. 1254 · ∆st− 1 − 1. 4833 · f pt− 1 f pt = − 0 .0003 + 0. 0079 · ∆st− 1 + 0. 7938 · f pt− 1
Since uscn.ts is a “timeSeries” object, the estimation time period is also displayed. The summary method gives more detailed information about the fitted VAR:
summary(var1.fit)
Call: VAR(formula = cbind(dspot, fp) ~ar(1), data = uscn.ts)
Coefficients: dspot fp (Intercept) -0.0036 -0. (std.err) 0.0012 0. (t.stat) -2.9234 -3.
dspot.lag1 -0.1254 0. (std.err) 0.0637 0. (t.stat) -1.9700 1.
fp.lag1 -1.4833 0. (std.err) 0.5980 0. (t.stat) -2.4805 20.
Regression Diagnostics: dspot fp R-squared 0.0365 0. Adj. R-squared 0.0285 0. Resid. Scale 0.0137 0.
Information Criteria: logL AIC BIC HQ 2058 -4104 -4083 -
total residual Degree of freedom: 243 240 Time period: from Apr 1976 to Jun 1996
In addition to the coefficient standard errors and t-statistics, summary also displays R^2 measures for each equation (which are valid because each equa-
11.2 The Stationary Vector Autoregression Model 393
tion is estimated by least squares). The summary output shows that the coefficients on ∆st− 1 and f pt− 1 in both equations are statistically signifi- cant at the 10% level and that the fit for the f pt equation is much better than the fit for the ∆st equation. As an aside, note that the S+FinMetrics function OLS may also be used to estimate each equation in a VAR model. For example, one way to com- pute the equation for ∆st using OLS is
dspot.fit = OLS(dspot~ar(1)+tslag(fp),data=uscn.ts) dspot.fit
Call: OLS(formula = dspot ~ar(1) + tslag(fp), data = uscn.ts)
Coefficients: (Intercept) tslag(fp) lag -0.0036 -1.4833 -0.
Degrees of freedom: 243 total; 240 residual Time period: from Apr 1976 to Jun 1996 Residual standard error: 0.
Graphical Diagnostics
The plot method for “VAR” objects may be used to graphically evaluate the fitted VAR. By default, the plot method produces a menu of plot options:
plot(var1.fit)
Make a plot selection (or 0 to exit):
1: plot: All 2: plot: Response and Fitted Values 3: plot: Residuals 4: plot: Normal QQplot of Residuals 5: plot: ACF of Residuals 6: plot: PACF of Residuals 7: plot: ACF of Squared Residuals 8: plot: PACF of Squared Residuals Selection:
Alternatively, plot.VAR may be called directly. The function plot.VAR has arguments
args(plot.VAR) function(x, ask = T, which.plots = NULL, hgrid = F, vgrid = F, ...)
11.2 The Stationary Vector Autoregression Model 395
-0.
-0.
-0.
1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996
dspot
-0.
-0.
fp
Residuals versus Time
FIGURE 11.4. Residuals from VAR(1) model fit to US/CN exchange rate data.
Notice that since the data are in a “timeSeries” object, the extracted residuals and fitted values are also “timeSeries” objects. The coefficients of the VAR model may be extracted using the generic coef function:
coef(var1.fit) dspot fp (Intercept) -0.003595149 -0. dspot.lag1 -0.125397056 0. fp.lag1 -1.483324622 0.
Notice that coef produces the (3 × 2) matrix Πˆ whose columns give the estimated coefficients for each equation in the VAR(1). To test stability of the VAR, extract the matrix Π 1 and compute its eigenvalues
PI1 = t(coef(var1.fit)[2:3,]) abs(eigen(PI1,only.values=T)$values) [1] 0.7808 0.
Since the modulus of the two eigenvalues of Π 1 are less than 1, the VAR(1) is stable.
396 11. Vector Autoregressive Models for Multivariate Time Series
Testing Linear Hypotheses
Now, consider testing the hypothesis that Π 1 = 0 (i.e., Yt− 1 does not help to explain Yt) using the Wald statistic (11.5). In terms of the columns of vec(Π) the restrictions are π 1 = (c 1 , 0 , 0)^0 and π 2 = (c 2 , 0 , 0) and may be expressed as Rvec(Π) = r with
,^ r^ =
The Wald statistic is easily constructed as follows
R = matrix(c(0,1,0,0,0,0,
vecPi = as.vector(var1.fit$coef) avar = R%%vcov(var1.fit)%%t(R) wald = t(R%%vecPi)%%solve(avar)%%(R%%vecPi) wald [,1] [1,] 417. 1-pchisq(wald,4) [1] 0
Since the p-value for the Wald statistic based on the χ^2 (4) distribution is essentially zero, the hypothesis that Π 1 = 0 should be rejected at any reasonable significance level.
Forecasting is one of the main objectives of multivariate time series analysis. Forecasting from a VAR model is similar to forecasting from a univariate AR model and the following gives a brief description.
Consider first the problem of forecasting future values of Yt when the parameters Π of the VAR(p) process are assumed to be known and there are no deterministic terms or exogenous variables. The best linear predictor, in terms of minimum mean squared error (MSE), of Yt+1 or 1-step forecast based on information available at time T is
YT +1|T = c + Π 1 YT + · · · + ΠpYT −p+
398 11. Vector Autoregressive Models for Multivariate Time Series
In practice, the second term M SE
YT +h − YˆT +h|T
is often ignored and
Σ^ ˆ(h) is computed using (11.7) as
Σ^ ˆ(h) =
hX− 1
s=
Ψ^ ˆs Σˆ Ψˆ^0 s (11.10)
with Ψˆs =
Ps j=1 Ψˆs−j^ Πˆj^. L¨utkepohl (1991, chapter 3) gives an approxi-
mation to MSE
YT +h − YˆT +h|T
which may be interpreted as a finite
sample correction to (11.10). Asymptotic (1−α)·100% confidence intervals for the individual elements of YˆT +h|T are then computed as
£ ˆyk,T +h|T − c 1 −α/ 2 ˆσk(h), yˆk,T +h|T + c 1 −α/ 2 σˆk(h)
where c 1 −α/ 2 is the (1 − α/2) quantile of the standard normal distribution
and ˆσk(h) denotes the square root of the diagonal element of Σˆ(h).
Example 66 Forecasting exchange rates from a bivariate VAR
Consider computing h-step forecasts, h = 1,... , 12, along with estimated forecast standard errors from the bivariate VAR(1) model for exchange rates. Forecasts and forecast standard errors from the fitted VAR may be computed using the generic S-PLUS predict method
uscn.pred = predict(var1.fit,n.predict=12)
The predict function recognizes var1.fit as a “VAR” object, and calls the appropriate method function predict.VAR. Alternatively, predict.VAR can be applied directly on an object inheriting from class “VAR”. See the online help for explanations of the arguments to predict.VAR. The output of predict.VAR is an object of class “forecast” for which there are print, summary and plot methods. To see just the forecasts, the print method will suffice:
uscn.pred
Predicted Values:
dspot fp 1-step-ahead -0.0027 -0. 2-step-ahead -0.0026 -0. 3-step-ahead -0.0023 -0. 4-step-ahead -0.0021 -0. 5-step-ahead -0.0020 -0. 6-step-ahead -0.0018 -0. 7-step-ahead -0.0017 -0.
11.3 Forecasting 399
8-step-ahead -0.0017 -0. 9-step-ahead -0.0016 -0. 10-step-ahead -0.0016 -0. 11-step-ahead -0.0015 -0. 12-step-ahead -0.0015 -0.
The forecasts and their standard errors can be shown using summary:
summary(uscn.pred)
Predicted Values with Standard Errors:
dspot fp 1-step-ahead -0.0027 -0. (std.err) 0.0137 0. 2-step-ahead -0.0026 -0. (std.err) 0.0139 0.
...
12-step-ahead -0.0015 -0. (std.err) 0.0140 0.
L¨utkepohl’s finite sample correction to the forecast standard errors com- puted from asymptotic theory may be obtained by using the optional ar- gument fs.correction=T in the call to predict.VAR. The forecasts can also be plotted together with the original data using the generic plot function as follows:
plot(uscn.pred,uscn.ts,n.old=12)
where the n.old optional argument specifies the number of observations to plot from uscn.ts. If n.old is not specified, all the observations in uscn.ts will be plotted together with uscn.pred. Figure 11.5 shows the forecasts produced from the VAR(1) fit to the US/CN exchange rate data^2. At the beginning of the forecast horizon the spot return is below its estimated mean value, and the forward premium is above its mean values. The spot return forecasts start off negative and grow slowly toward the mean, and the forward premium forecasts decline sharply toward the mean. The forecast standard errors for both sets of forecasts, however, are fairly large.
(^2) Notice that the dates associated with the forecasts are not shown. This is the result of “timeDate” objects not having a well defined frequency from which to extrapolate dates.
11.3 Forecasting 401
uscn.pred.MC = predict(var1.fit,n.predict=12,method="mc") summary(uscn.pred.MC)
Predicted Values with Standard Errors:
dspot fp 1-step-ahead -0.0032 -0. (std.err) 0.0133 0. 2-step-ahead -0.0026 -0. (std.err) 0.0133 0. ... 12-step-ahead -0.0013 -0. (std.err) 0.0139 0.
The Monte Carlo forecasts and forecast standard errors for f pt+h are almost identical to those computed using the chain-rule of forecasting. The Monte Carlo forecasts for ∆st+h are slightly different and the forecast standard errors are slightly larger than the corresponding values computed from the chain-rule. The h-step forecasts computed from the bootstrap simulation method are
uscn.pred.boot = predict(var1.fit,n.predict=12,
summary(uscn.pred.boot)
Predicted Values with Standard Errors:
dspot fp 1-step-ahead -0.0020 -0. (std.err) 0.0138 0. 2-step-ahead -0.0023 -0. (std.err) 0.0140 0. ... 12-step-ahead -0.0023 -0. (std.err) 0.0145 0.
As with the Monte Carlo forecasts, the bootstrap forecasts and forecast standard errors for f pt+h are almost identical to those computed using the chain-rule of forecasting. The bootstrap forecasts for ∆st+h are slightly different from the chain-rule and Monte Carlo forecasts. In particular, the bootstrap forecast standard errors are larger than corresponding values from the chain-rule and Monte Carlo methods. The simulation-based forecasts described above are different from the traditional simulation-based approach taken in VAR literature, e.g., see
402 11. Vector Autoregressive Models for Multivariate Time Series
Runkle (1987). The traditional approach is implemented using the following procedure:
The above procedure is repeated many times to obtain simulation-based forecasts as well as their confidence intervals. To illustrate this approach, generate 12-step ahead forecasts from the fitted VAR object var1.fit by Monte Carlo simulation using the S+FinMetrics function simulate.VAR as follows:
set.seed(10) n.pred= n.sim= sim.pred = array(0,c(n.sim, n.pred, 2)) y0 = seriesData(var1.fit$Y0) for (i in 1:n.sim) {
The simulation-based forecasts are obtained by averaging the simulated forecasts:
colMeans(sim.pred) [,1] [,2] [1,] -0.0017917 -0. [2,] -0.0017546 -0. [3,] -0.0017035 -0. [4,] -0.0016800 -0. [5,] -0.0016587 -0. [6,] -0.0016441 -0. [7,] -0.0016332 -0. [8,] -0.0016253 -0. [9,] -0.0016195 -0. [10,] -0.0016153 -0. [11,] -0.0016122 -0. [12,] -0.0016099 -0.