Chapter 1 VARs and IRFs: the basics

Often, impulse response functions (IRFs) are generated in the context of vectorial autoregressive (VAR) models. This section presents these models and shows how they can be used to compute IRFs.

1.1 Definition of VARs (and SVARMA) models

Definition 1.1 ((S)VAR model) Let \(y_{t}\) denote a \(n \times1\) vector of (endogenous) random variables. Process \(y_{t}\) follows a \(p^{th}\)-order (S)VAR if, for all \(t\), we have \[\begin{eqnarray} \begin{array}{rllll} VAR:& y_t &=& c + \Phi_1 y_{t-1} + \dots + \Phi_p y_{t-p} + \varepsilon_t,\\ SVAR:& y_t &=& c + \Phi_1 y_{t-1} + \dots + \Phi_p y_{t-p} + B \eta_t, \end{array} \tag{1.1} \end{eqnarray}\] with \(\varepsilon_t=B\eta_t\), where \(B\) is nonsingular and \(\eta_t\) is i.i.d. over time, has zero mean and covariance \(I_n\). Its components are orthogonal. Mutual independence is a stronger assumption, automatic for Gaussian shocks and explicitly imposed when required below, especially in Chapter 7. Orthogonality alone suffices for covariance decompositions.

The first line of Eq. (1.1) corresponds to the reduced-form of the VAR model (structural form for the second line). While the structural shocks (the components of \(\eta_t\)) are mutually uncorrelated, the innovations, which are the components of \(\varepsilon_t\), can be contemporaneously correlated. However, in both cases, vectors \(\eta_t\) and \(\varepsilon_t\) are serially uncorrelated (through time).

Notice that \(\mathbb{V}ar(\eta_t)=Id\) and \(\varepsilon_t = B\eta_t\) jointly imply that \[ \Omega :=\mathbb{V}ar(\varepsilon_t)=\mathbb{V}ar(B\eta_t)= B \mathbb{V}ar(\eta_t) B'=BB'. \]

Using the lag operator, \(Ly_t=y_{t-1}\), the VAR equation is \[ y_t=c+\sum_{j=1}^p\Phi_jL^jy_t+\varepsilon_t. \] The autoregressive polynomial used below is \(\Phi(L)=I-\sum_{j=1}^p\Phi_jL^j\).

As is the case for univariate models, VARs can be extended with MA terms in \(\eta_t\), giving rise to VARMA models:

Definition 1.2 ((S)VARMA model) Let \(y_{t}\) denote a \(n \times1\) vector of random variables. Process \(y_{t}\) follows a VARMA model of order (p,q) if, for all \(t\), we have \[\begin{eqnarray} \begin{array}{rllll} VARMA:& y_t &=& c + \Phi_1 y_{t-1} + \dots + \Phi_p y_{t-p} + \\ &&&\varepsilon_t + \Theta_1\varepsilon_{t-1} + \dots + \Theta_q \varepsilon_{t-q},\\ SVARMA:& y_t &=& c + \Phi_1 y_{t-1} + \dots + \Phi_p y_{t-p} + \\ &&& B_0 \eta_t + B_1 \eta_{t-1} + \dots + B_q \eta_{t-q}, \end{array} \tag{1.2} \end{eqnarray}\] with \(\varepsilon_t=B_0\eta_t\) and \(B_j=\Theta_jB_0\), where \(\Theta_0=I_n\), \(B_0\) is nonsingular, and \(\eta_t\) has the i.i.d., zero-mean, identity-covariance properties specified above.

1.2 IRFs in SVARMA

One of the main objectives of macro-econometrics is to derive IRFs, that represent the dynamic effects of structural shocks (components of \(\eta_t\)) through the system of variables \(y_t\).

An IRF is the change produced by adding one unit to one structural shock while holding all other shocks and presample values fixed. In a linear model, it is also the derivative \(\partial y_{i,t+h}/\partial\eta_{j,t}\). If the shock components are mutually independent, this equals the following conditional-expectation contrast (with a regular conditional mean where needed): \[\begin{equation} \boxed{\Psi_{i,j,h} = \mathbb{E}(y_{i,t+h}|\eta_{j,t}=1) - \mathbb{E}(y_{i,t+h})} \tag{1.3} \end{equation}\] (effect on \(y_{i,t+h}\) of a one-unit shock on \(\eta_{j,t}\)).

For a stable causal VARMA, initialized in its stationary law, the structural moving-average representation is: \[\begin{equation} \boxed{y_t = \mu + \sum_{i=0}^\infty \Psi_{i} \eta_{t-i}.} \tag{1.4} \end{equation}\] or, shifted by \(h\) periods: \[\begin{eqnarray*} y_{t+h} &=& \mu + \sum_{i=0}^\infty \Psi_{i} \eta_{t+h-i}\\ &=& \mu + \underbrace{\sum_{i=0}^{h-1} \Psi_{i} \eta_{t+h-i}}_{\mbox{Effect of }\eta_{t+1},\dots,\eta_{t+h}} + \underbrace{\Psi_{h} \eta_{t}}_{\mbox{Effect of }\eta_{t}} + \underbrace{\sum_{i=h+1}^\infty \Psi_{i} \eta_{t+h-i}}_{\mbox{Effect of }\eta_{t-1},\eta_{t-2,\dots}}. \end{eqnarray*}\]

Under mutually independent shock components, we get \(\mathbb{E}(y_{i,t+h}|\eta_{j,t}=1) = \mu_i + \Psi_{i,j,h}\), where \(\Psi_{i,j,h}\) is the component \((i,j)\) of matrix \(\Psi_h\) and \(\mu_i\) is the \(i^{th}\) entry of vector \(\mu\). Since we also have \(\mathbb{E}(y_{i,t+h})=\mu_i\), we obtain Eq. (1.3).

Example 1.1 (IRF of a univariate AR model) To fix ideas, consider a simple univariate AR(1) process: \[ y_t = \phi y_{t-1} + b \eta_t, \quad \eta_t \sim \text{i.i.d. }\mathcal{N}(0,1). \]

We assume \(|\phi|<1\) and use the causal stationary solution, with the initial state independent of future shocks.

Iterating forward: \[ y_{t+h} = b \eta_{t+h} + \phi b \eta_{t+h-1} + \dots + \phi^h b \eta_t + \phi^{h+1} y_{t-1}. \] If the \(\eta_t\)’s are independent, we have \(\mathbb{E}(\eta_{t+h}|\eta_t = 1)=0\) if \(h \ne 0\) (and 1 otherwise). Therefore: \[ \mathbb{E}(y_{t+h}|\eta_t = 1) - \mathbb{E}(y_{t+h}) = \phi^h b. \] Hence, the impulse response function (IRF) at horizon \(h\) is simply \(\Psi_h=\phi^h b\).

Code
phi <- .8
b <- .5
plot(0:30,phi^(0:30)*b,type="b",lwd=2,xlab="Periods after shock",ylab="",las=1)
grid()
Impulse response functions for an AR(1) process: $y_t = \phi y_{t-1} + b \eta_t$, $\eta_t \sim i.i.d. \mathcal{N}(0,1)$.

Figure 1.1: Impulse response functions for an AR(1) process: \(y_t = \phi y_{t-1} + b \eta_t\), \(\eta_t \sim i.i.d. \mathcal{N}(0,1)\).

Hence, estimating IRFs amounts to estimating the \(\Psi_h\) matrices. In practice, three main approaches are commonly used:

  • Calibrate and solve a (purely structural) Dynamic Stochastic General Equilibrium (DSGE) model at first order (linear approximation). The resulting solution can be written in the form of Eq. (1.4).

  • Directly estimate the \(\Psi_h\) matrices using projection methods (see Section 8).

  • Approximate the infinite moving-average representation by estimating a parsimonious model, such as a VAR(MA) model (see Section 1.4). Once a (structural) VARMA representation is obtained, Eq. (1.4) follows immediately from the result stated in the next proposition.

Proposition 1.1 (IRF of a VARMA(p,q) process) For the stable causal VARMA solution described in Def. 1.2, the matrices \(\Psi_h\) appearing in Eq. (1.4) can be computed recursively as follows:

  1. Set \(\Psi_{-1}=\dots=\Psi_{-p}=0\).
  2. For \(h \ge 0\), (recursively) apply: \[ \Psi_h = \Phi_1 \Psi_{h-1} + \dots + \Phi_p \Psi_{h-p} + \Theta_h B_0, \] with \(\Theta_0 = Id\) and \(\Theta_h = 0\) for \(h>q\).

Proof. This is obtained by applying the operator \(\frac{\partial}{\partial \eta_{t}}\) on both sides of Eq. (1.2).

Typically, consider the VAR(2) case. The first steps of the algorithm mentioned in the last bullet point are as follows: \[\begin{eqnarray*} y_t &=& \Phi_1 {\color{blue}y_{t-1}} + \Phi_2 y_{t-2} + B \eta_t \\ &=& \Phi_1 {\color{blue}(\Phi_1 y_{t-2} + \Phi_2 y_{t-3} + B \eta_{t-1})} + \Phi_2 y_{t-2} + B \eta_t \\ &=& B \eta_t + \Phi_1 B \eta_{t-1} + (\Phi_2 + \Phi_1^2) {\color{red}y_{t-2}} + \Phi_1\Phi_2 y_{t-3} \\ &=& B \eta_t + \Phi_1 B \eta_{t-1} + (\Phi_2 + \Phi_1^2) {\color{red}(\Phi_1 y_{t-3} + \Phi_2 y_{t-4} + B \eta_{t-2})} + \Phi_1\Phi_2 y_{t-3} \\ &=& \underbrace{B}_{=\Psi_0} \eta_t + \underbrace{\Phi_1 B}_{=\Psi_1} \eta_{t-1} + \underbrace{(\Phi_2 + \Phi_1^2)B}_{=\Psi_2} \eta_{t-2} + f(y_{t-3},y_{t-4}). \end{eqnarray*}\]

A structural MA representation is a rotation of the Wold innovation representation only when the shocks are fundamental for the observed history. Stable invertibility of the MA polynomial is sufficient for this recovery, but covariance stationarity alone does not establish it.

In a VAR, we have \(B=\Psi_0\) (and \(B_0=\Psi_0\) in a VARMA). Matrix \(B\) indeed captures the contemporaneous impact of \(\eta_t\) on \(y_t\). That is why matrix \(B\) is sometimes called impulse matrix.

Example 1.2 (IRFs of an SVAR model) Consider the following VAR(2) model: \[\begin{eqnarray} \quad y_t &=& \underbrace{\left[\begin{array}{cc} 0.6 & 0.2 \\ 0 & 0.5 \end{array}\right]}_{=\Phi_1} y_{t-1} + \underbrace{\left[\begin{array}{cc} -0.1 & 0.1 \\ 0.2 & 0.3 \end{array}\right]}_{=\Phi_2}y_{t-2} + \underbrace{\left[\begin{array}{cc} 0.5 & 1.5 \\ -1 & 0.8 \end{array}\right]}_{=B} \eta_{t}. \tag{1.5} \end{eqnarray}\]

We can use function simul.VARMA of package IdSS to produce IRFs (using indic.IRF=1 in the list of arguments):

Code
library(IdSS)
# ---- Specify model: ----
Phi <- array(NaN,c(2,2,2)) # (2,2,2) for (n,n,p)
Phi[,,1] <- matrix(c(.6,0,.2,.5),2,2)
Phi[,,2] <- matrix(c(-.1,.2,.1,.3),2,2)
c <- c(1,2)
B <- matrix(c(.5,-1,1.5,.8),2,2)
Model <- list(c = c,Phi = Phi,B = B)
# ---- Define first shock: ----
eta0 <- c(1,0)
res.sim.1 <- simul.VARMA(Model,nb.sim=30,eta0=eta0,indic.IRF=1)
# ---- Define second shock: ----
eta0 <- c(0,1)
res.sim.2 <- simul.VARMA(Model,nb.sim=30,eta0=eta0,indic.IRF=1)
# ---- Prepare plots: ----
par(plt=c(.15,.95,.25,.8)) # define margins
par(mfrow=c(2,2)) # 2 rows and 2 columns of plots
for(i in 1:2){
  if(i == 1){res.sim <- res.sim.1}else{res.sim <- res.sim.2}
  for(j in 1:2){
    plot(0:(ncol(res.sim$Y)-1),res.sim$Y[j,],las=1,
         type="l",lwd=3,xlab="",ylab="",
         main=bquote("Resp. of "*y[.(j)]*" to a unit "*eta[.(i)]*" shock"))
    abline(h=0,col="grey",lty=3)
  }}
Impulse response functions (VAR(2) specified above).

Figure 1.2: Impulse response functions (VAR(2) specified above).

The same type of output would be obtained by using the function simul.VAR of package IdSS:1

Code
res.sim <- simul.VAR(c=c,Phi=Phi,B=B,nb.sim=30,indic.IRF=1,u.shock=eta0)

Example 1.3 (IRFs of an SVARMA model) Consider the following VARMA(1,1) model: \[\begin{eqnarray} \quad y_t &=& \underbrace{\left[\begin{array}{cc} 0.5 & 0.3 \\ -0.4 & 0.7 \end{array}\right]}_{\Phi_1} y_{t-1} + \\ && \underbrace{\left[\begin{array}{cc} 1 & 2 \\ -1 & 1 \end{array}\right]}_{B}\eta_t + \underbrace{\left[\begin{array}{cc} 0.4 & 0 \\ -1 & -0.5 \end{array}\right]}_{\Theta_1} \underbrace{\left[\begin{array}{cc} 1 & 2 \\ -1 & 1 \end{array}\right]}_{B}\eta_{t-1}. \tag{1.6} \end{eqnarray}\]

We can use function simul.VARMA of package IdSS to produce IRFs (using indic.IRF=1 in the list of arguments):

Code
library(IdSS)
# ---- Specify model: ----
Phi <- array(NaN,c(2,2,1)) # (2,2,1) for (n,n,p)
Phi[,,1] <- matrix(c(.5,-.4,.3,.7),2,2)
p <- dim(Phi)[3]
Theta <- array(NaN,c(2,2,1))
Theta[,,1] <- matrix(c(.4,-1,0,-.5),2,2)
q <- dim(Theta)[3]
c <- rep(0,2)
B <- matrix(c(1,-1,2,1),2,2)
Model <- list(c = c,Phi = Phi,Theta = Theta,B = B)
# ---- Define first shock: ----
eta0 <- c(1,0)
res.sim.1 <- simul.VARMA(Model,nb.sim=30,eta0=eta0,indic.IRF=1)
# ---- Define second shock: ----
eta0 <- c(0,1)
res.sim.2 <- simul.VARMA(Model,nb.sim=30,eta0=eta0,indic.IRF=1)
par(plt=c(.15,.95,.25,.8))
par(mfrow=c(2,2))
for(i in 1:2){
  if(i == 1){res.sim <- res.sim.1}else{res.sim <- res.sim.2}
  for(j in 1:2){
    plot(0:(ncol(res.sim$Y)-1),res.sim$Y[j,],las=1,
         type="l",lwd=3,xlab="",ylab="",
         main=bquote("Resp. of "*y[.(j)]*" to a unit "*eta[.(i)]*" shock"))
    abline(h=0,col="grey",lty=3)
  }}
Impulse response functions (SVARMA(1,1) specified above).

Figure 1.3: Impulse response functions (SVARMA(1,1) specified above).

1.3 Covariance-stationary VARMA models

Let’s come back to the infinite MA case (Eq. (1.4)): \[ y_t = \mu + \sum_{h=0}^\infty \Psi_{h} \eta_{t-h}. \] For a causal linear process driven by i.i.d. unit-covariance shocks, square summability, \(\sum_{j\ge0}\|\Psi_j\|^2<\infty\), ensures mean-square convergence and finite covariance. The resulting stationary solution is an ergodic function of the shock history. The stronger condition \[\begin{equation} \sum_{j=0}^\infty\|\Psi_j\|<\infty \tag{1.7} \end{equation}\] is sufficient, and holds for stable finite-order VARMA models; it is not necessary for general stationary linear processes. Both summability conditions imply \(\|\Psi_h\|\to0\). Here \(\|A\|\) may be the Frobenius norm, \(\sqrt{\operatorname{tr}(AA')}\).

What should be satisfied by \(\Phi_k\)’s and \(\Theta_k\)’s for a VARMA-based process (Eq. (1.2)) to be stationary? The conditions will be similar to that we have in the univariate case. Let us introduce the following notations: \[\begin{equation} \begin{aligned} y_t &= c + \underbrace{\Phi_1 y_{t-1} + \dots + \Phi_p y_{t-p}}_{\text{AR component}} \\ &\quad + \underbrace{B\eta_t + \Theta_1 B\eta_{t-1} + \dots + \Theta_q B\eta_{t-q}}_{\text{MA component}}, \\ \underbrace{(I - \Phi_1 L - \dots - \Phi_p L^p)}_{\Phi(L)}y_t &= c + \underbrace{(I + \Theta_1 L + \dots + \Theta_q L^q)}_{\Theta(L)}B\eta_t. \end{aligned} \tag{1.8} \end{equation}\]

After removing cancellations between the AR and MA transfer functions, a minimal VARMA admits a causal covariance-stationary solution if and only if its AR poles lie outside the unit circle. Equivalently, the eigenvalues of \[\begin{equation} \underbrace{\Phi}_{np \times np} = \left[\begin{array}{cccc} \Phi_{1} & \Phi_{2} & \cdots & \Phi_{p}\\ I & 0 & \cdots & 0\\ 0 & \ddots & 0 & 0\\ 0 & 0 & I & 0\end{array}\right] \tag{1.9} \end{equation}\] lie strictly inside the unit circle. This criterion concerns causal solutions of the minimal representation: cancelled AR roots do not create instability, and noncausal solutions depending on future shocks are excluded.

Let’s derive the first two unconditional moments of a (covariance-stationary) VARMA process.

Eq. (1.8) gives \(\mathbb{E}(\Phi(L)y_t)=c\), therefore \(\Phi(1)\mathbb{E}(y_t)=c\), or \[ \mathbb{E}(y_t) = (I - \Phi_1 - \dots - \Phi_p)^{-1}c. \] For \(j\ge0\), the autocovariances of \(y_t\) can be deduced from the infinite MA representation (Eq. (1.4)). We have: \[ \gamma_j \equiv \mathbb{C}ov(y_t,y_{t-j}) = \sum_{i=j}^\infty \Psi_i \Psi_{i-j}'. \] Indeed: \[\begin{eqnarray*} \mathbb{C}ov(y_t,y_{t-j}) &=& \mathbb{E}\left(\left[\sum_{h=0}^\infty \Psi_{h} \eta_{t-h}\right]\left[\sum_{h=0}^\infty \Psi_{h} \eta_{t-j-h}\right]'\right)\\ &=& \mathbb{E}\left(\left[\sum_{i=0}^{j-1} \Psi_{i} \eta_{t-i}+\sum_{i=j}^\infty \Psi_{i} \eta_{t-i}\right]\left[\sum_{i=j}^\infty \Psi_{i-j} \eta_{t-i}\right]'\right)\\ &=&\mathbb{E}\left(\sum_{i=j}^\infty \Psi_{i} \eta_{t-i}\eta_{t-i}'\Psi_{i-j}'\right)= \sum_{i=j}^\infty \Psi_i \Psi_{i-j}'. \end{eqnarray*}\] For negative lags, \(\gamma_{-j}=\gamma_j\prime\), which generally differs from \(\gamma_j\). Square summability already suffices for these covariance sums.

Conditional means and autocovariances can also be deduced from Eq. (1.4). For \(0 \le h\) and \(0 \le h_1 \le h_2\): \[\begin{eqnarray*} \mathbb{E}_t(y_{t+h}) &=& \mu + \sum_{k=0}^\infty \Psi_{k+h} \eta_{t-k} \\ \mathbb{C}ov_t(y_{t+1+h_1},y_{t+1+h_2}) &=& \sum_{k=0}^{h_1} \Psi_{k}\Psi_{k+h_2-h_1}', \end{eqnarray*}\] where \(\mathbb{E}_t\) and \(\mathbb{C}ov_t\) denote the expectation and covariance conditional on \(\{\eta_t,\eta_{t-1},\dots\}\).2

The previous formula implies in particular that the forecasting error \(y_{t+h} - \mathbb{E}_t(y_{t+h})\) has a variance equal to: \[ \boxed{\mathbb{V}ar_t(y_{t+h}) = \sum_{k=0}^{h-1} \Psi_{k}\Psi_{k}'.} \] Because the components of \(\eta_t\) are orthogonal with unit variance, and the shock vector is independent over time, we have: \[ \mathbb{V}ar(\Psi_k \eta_{t-k}) = \mathbb{V}ar\left(\sum_{i=1}^n \psi_{k,i} \eta_{i,t-k}\right) = \sum_{i=1}^n \psi_{k,i}\psi_{k,i}', \] where \(\psi_{k,i}\) denotes the \(i^{th}\) column of \(\Psi_k\). This suggests the following decomposition of the variance of the forecast error (called variance decomposition): \[ \mathbb{V}ar_t(y_{t+h}) = \sum_{i=1}^n \underbrace{\sum_{k=0}^{h-1}\psi_{k,i}\psi_{k,i}'.}_{\mbox{Contribution of $\eta_{i,t}$}} \]

To illustrate, let us use the VAR(2) model proposed above, in Example 1.2. As explained above, the variance decomposition directly results from the knowledge of IRFs (shown in Figure 1.2):

Example 1.4 (Variance decomposition in the context of a VAR(2) defined.) The chunk below computes, for different horizons, the shares of the variances of the two variables that are accounted for by each of the two components of \(\eta_t\) in the context of the model proposed in Example 1.2.

Code
Phi <- array(NaN,c(2,2,2)) # (2,2,2) for (n,n,p)
Phi[,,1] <- matrix(c(.6,0,.2,.5),2,2)
Phi[,,2] <- matrix(c(-.1,.2,.1,.3),2,2)
B <- matrix(c(.5,-1,1.5,.8),2,2)
make.variance.decompo(Phi,B,maxHorizon=30)
Variance decomposition of a VAR(2) model.

Figure 1.4: Variance decomposition of a VAR(2) model.

1.4 VAR estimation

This section discusses the estimation of VAR models.3 Write the VAR as \[ y_t=c+\sum_{j=1}^p\Phi_jy_{t-j}+\varepsilon_t. \] For estimation below, the causal stable solution has i.i.d. innovations of mean zero and positive-definite covariance \(\Omega\). These assumptions are stronger than mere serial uncorrelatedness. Condition on all required presample lags and count \(T\) usable regression dates.

Using Hamilton (1994)’s notations, denote with \(\Pi\) the matrix \(\left[\begin{array}{ccccc} c & \Phi_{1} & \Phi_{2} & \ldots & \Phi_{p}\end{array}\right]'\) and with \(x_{t}\) the vector \(\left[\begin{array}{ccccc} 1 & y'_{t-1} & y'_{t-2} & \ldots & y'_{t-p}\end{array}\right]'\), we have: \[\begin{equation} y_{t}= \Pi'x_{t} + \varepsilon_{t}. \tag{1.10} \end{equation}\]

The previous representation is convenient to discuss the estimation of the VAR model, as parameters are gathered in two matrices only: \(\Pi\) and \(\Omega\) (where \(\Omega = \mathbb{V}ar (\varepsilon_t)\)).

1.4.1 Maximum Likelihood Estimation (MLE) when the shocks are Gaussian

Let us start with the case where the shocks are i.i.d. Gaussian. We then have: \[ y_{t}\mid y_{t-1},y_{t-2},\ldots\sim \mathcal{N}(c+\Phi_{1}y_{t-1}+\ldots\Phi_{p}y_{t-p},\Omega). \]

Proposition 1.2 (MLE of a Gaussian VAR) Assume a stable causal VAR(\(p\)), i.i.d. Gaussian innovations with \(\Omega>0\), and a full-column-rank design \(X\). If the parameter space is constrained to stable VARs, also assume the unrestricted OLS solution belongs to that space. If these conditions hold, then, conditionally on the presample lags, the Gaussian ML estimate of \(\Pi\), denoted by \(\hat{\Pi}\) (see Eq. (1.10)), is given by \[\begin{equation} \hat{\Pi}=\left[\sum_{t=1}^{T}x_{t}x'_{t}\right]^{-1}\left[\sum_{t=1}^{T}x_ty_t'\right]= (\mathbf{X}'\mathbf{X})^{-1}\mathbf{X}'\mathbf{y}, \tag{1.11} \end{equation}\] where \(\mathbf{X}\) is the \(T \times (1+np)\) matrix whose \(t^{th}\) row is \(x_t'\) and where \(\mathbf{y}\) is the \(T \times n\) matrix whose \(t^{th}\) row is \(y_{t}'\).

That is, the \(i^{th}\) column of \(\hat{\Pi}\) (\(b_i\), say) is the OLS estimate of \(\beta_i\), where: \[\begin{equation} y_{i,t} = \beta_i'x_t + \varepsilon_{i,t}, \tag{1.12} \end{equation}\] Here \(\beta_i'=[c_i,\phi_{i,1}',\ldots,\phi_{i,p}']\), where \(\phi_{i,j}'\) is row \(i\) of \(\Phi_j\).

If the residual cross-product matrix is positive definite, the ML estimate of \(\Omega\), denoted by \(\hat{\Omega}\), is the average outer product of the \(n\) series of the OLS residuals in Eq. (1.12), i.e.: \[\begin{equation} \hat{\Omega} = \frac{1}{T} \sum_{t=1}^T \hat{\varepsilon}_t\hat{\varepsilon}_t',\quad\mbox{with } \hat{\varepsilon}_t= y_t - \hat{\Pi}'x_t. \end{equation}\]

The covariance divisor is \(T\), not the regression degrees of freedom or the \(T-1\) divisor of var. Stationarity enters the asymptotic results, not the algebra of conditional maximization. The exact stationary likelihood additionally includes the parameter-dependent presample density.

Proof. See Appendix 11.3.

The simplicity of the VAR framework and the tractability of its MLE open the way to convenient econometric testing. Let’s illustrate this with the likelihood ratio test (see Def. 11.2). The maximum value achieved by the MLE is \[ \log\mathcal{L}(Y_{T};\hat{\Pi},\hat{\Omega}) = -\frac{Tn}{2}\log(2\pi)+\frac{T}{2}\log\left|\hat{\Omega}^{-1}\right| -\frac{1}{2}\sum_{t=1}^{T}\left[\hat{\varepsilon}_{t}'\hat{\Omega}^{-1}\hat{\varepsilon}_{t}\right]. \] The last term is: \[\begin{eqnarray*} \sum_{t=1}^{T}\hat{\varepsilon}_{t}'\hat{\Omega}^{-1}\hat{\varepsilon}_{t} &=& \mbox{Tr}\left[\sum_{t=1}^{T}\hat{\varepsilon}_{t}'\hat{\Omega}^{-1}\hat{\varepsilon}_{t}\right] = \mbox{Tr}\left[\sum_{t=1}^{T}\hat{\Omega}^{-1}\hat{\varepsilon}_{t}\hat{\varepsilon}_{t}'\right]\\ &=&\mbox{Tr}\left[\hat{\Omega}^{-1}\sum_{t=1}^{T}\hat{\varepsilon}_{t}\hat{\varepsilon}_{t}'\right] = \mbox{Tr}\left[\hat{\Omega}^{-1}\left(T\hat{\Omega}\right)\right]=Tn. \end{eqnarray*}\] Therefore, the optimized log-likelihood is simply obtained by: \[\begin{equation} \log\mathcal{L}(Y_{T};\hat{\Pi},\hat{\Omega})=-(Tn/2)\log(2\pi)+(T/2)\log\left|\hat{\Omega}^{-1}\right|-Tn/2. \tag{1.13} \end{equation}\]

Having the optimized likelihood in analytical form allows for flexible applications of the likelihood ratio (LR) test (Def. 11.2).

Example 1.5 (Ad-hoc lag selection based on the LR test) Suppose we want to test whether a system of variables follows a VAR(\(p_0\)) process (the null hypothesis) against an alternative specification with \(p_1\) lags, where \(p_1 > p_0\). Let \(\hat{L}_0\) and \(\hat{L}_1\) denote the maximum log-likelihoods obtained under the two specifications, respectively. Under the null hypothesis (\(H_0\): \(p = p_0\)), the LR statistic is given by

\[\begin{equation} \xi^{LR} := 2(\hat{L}_1 - \hat{L}_0) = T \left( \log\left|\hat{\Omega}_1^{-1}\right| - \log\left|\hat{\Omega}_0^{-1}\right| \right) \overset{d}{\longrightarrow} \chi^2\left(n^2(p_1 - p_0)\right). \end{equation}\]

Use the same usable observations for both likelihoods. The chi-square reference is asymptotic and requires the regular stable Gaussian null, identifiable interior parameters and full-rank restrictions; it is not an exact finite-sample distribution. However, including too many lags quickly exhausts degrees of freedom: with \(p\) lags, each of the \(n\) equations in the VAR includes \(n \times p\) coefficients plus an intercept term. While adding lags always improves the in-sample fit, it can lead to over-parameterization and deteriorate the model’s out-of-sample predictive performance.

The approach above provides an ad-hoc way to select lag length using LR tests (Def. 11.2). More systematic procedures rely on information criteria, which balance goodness of fit and model parsimony. In the Gaussian case (see Eq. (1.13)), common criteria include: \[\begin{eqnarray*} AIC & = & cst + \log\left|\hat{\Omega}\right| + \frac{2}{T}N \\ BIC & = & cst + \log\left|\hat{\Omega}\right| + \frac{\log T}{T}N, \end{eqnarray*}\] where \(N=n(1+np)+n(n+1)/2\) counts the estimated mean/dynamic and covariance parameters. Terms constant across the compared lag orders may be dropped, giving the familiar penalty based on \(pn^2\); all orders must use a common sample. In these expressions, \(\log|\hat{\Omega}|\) captures the model’s goodness of fit (with smaller values indicating better fit), while the last term is a penalty that increases with the number of estimated parameters.

Example 1.6 (Three-variable VAR model) The following example illustrates how to estimate and analyze a three-variable VAR model using U.S. quarterly data on annualized GDP-deflator inflation, the output gap, and the federal funds rate. Both rates are in annual percent; the output gap is in percent.

We begin by using the VARselect function from the vars package to determine the optimal lag length for the VAR specification.

Code
library(vars)   # provides 'VARselect' function
library(IdSS)   # dataset is included here

First.date <- "1959-04-01"
Last.date  <- "2015-01-01"

data <- US3var
data <- data[(data$Date >= First.date) & (data$Date <= Last.date), ]
Y <- as.matrix(data[c("infl", "y.gdp.gap", "r")])

VARselect(Y, lag.max = 12)
## $selection
## AIC(n)  HQ(n)  SC(n) FPE(n) 
##     11      3      2     11 
## 
## $criteria
##                1          2         3        4        5        6
## AIC(n) -0.143409 -0.3230022 -0.397967 -0.38885 -0.41100 -0.52297
## HQ(n)  -0.066617 -0.1886167 -0.205988 -0.13928 -0.10383 -0.15821
## SC(n)   0.046586  0.0094898  0.077021  0.22864  0.34898  0.37951
## FPE(n)  0.866411  0.7240244  0.671825  0.67815  0.66356  0.59362
##                7        8         9       10       11       12
## AIC(n) -0.488400 -0.50158 -0.446138 -0.49509 -0.53721 -0.49806
## HQ(n)  -0.066046 -0.02163  0.091404  0.10004  0.11552  0.21226
## SC(n)   0.556575  0.68589  0.883830  0.97737  1.07775  1.25940
## FPE(n)  0.614989  0.60758  0.643083  0.61339  0.58929  0.61433

Next, we estimate a pure three-variable VAR. Treating a contemporaneous commodity-price variable as exogenous would require additional identifying moment conditions, so it is not included in this basic illustration.

Code
p <- 6
estVAR <- VAR(Y, p = p) # estimate the VAR model
Phi <- Acoef(estVAR)
eps <- residuals(estVAR)
Omega <- crossprod(eps)/nrow(eps) # conditional Gaussian covariance estimate
B <- t(chol(Omega)) # Cholesky decomposition of Omega (lower triangular)

We can now verify whether the estimated VAR is stationary:

Code
PHI <- make.PHI(Phi) # autoregressive matrix in companion form
print(Mod(eigen(PHI)$values)) # eigenvalues must be < 1 for stationarity
##  [1] 0.96137 0.96137 0.92073 0.85441 0.85441 0.77938 0.77938
##  [8] 0.75408 0.75408 0.74869 0.74869 0.74154 0.74154 0.67973
## [15] 0.67973 0.47048 0.47048 0.31407

The estimated companion eigenvalues must have moduli below one for this fitted model to be stable. This numerical check does not establish stationarity of the observed economy.

We then compute and display the impulse response functions (IRFs) using the Cholesky identification approach (see Section 2.3), where the impact matrix \(B\) comes from the Cholesky factorization of \(\Omega = \mathbb{V}ar(\varepsilon_t)\).

Code
n <- dim(Y)[2] # number of endogenous variables
par(mfrow = c(n, n))
par(plt = c(.3, .95, .2, .8))
Model <- list(c = c, Phi = Phi, B = B)
names.var <- c("Inflation", "Output gap", "Interest rate")

for (variable in 1:n) {
  for (shock in 1:n) {
    eta0 <- rep(0, n)
    eta0[shock] <- 1
    res.sim <- simul.VAR(c = NaN, Phi, B, nb.sim = 30, indic.IRF = 1,
                         u.shock = eta0)
    plot(0:(nrow(res.sim)-1),res.sim[, variable], type = "l", lwd = 2, las = 1,
         xlab = "", ylab = ifelse(shock==1,
                                  paste("Resp. of ",
                                              names.var[variable],"...",sep=""),""),
         main = if (variable==1) bquote("... to shock "*eta[.(shock)]) else ""
         )}
}
Impulse response functions for a 3-variable VAR model estimated on U.S. quarterly data.

Figure 1.5: Impulse response functions for a 3-variable VAR model estimated on U.S. quarterly data.

Finally, we compute the variance decomposition associated with the same model.

Code
make.variance.decompo(Phi, B, maxHorizon = 50,
                      names.var = c("Inflation", "Real activity",
                                    "Short-term rate"))
Variance decomposition for a 3-variable VAR model estimated on U.S. quarterly data.

Figure 1.6: Variance decomposition for a 3-variable VAR model estimated on U.S. quarterly data.

1.4.2 Asymptotic distribution of the OLS estimates

As stated by the following proposition, when the shocks \(\varepsilon_t\) are not Gaussian, then the OLS regressions still provide consistent estimates of the model parameters.

Proposition 1.3 (Asymptotic distribution of the OLS estimate of VAR coefficients (for one variable)) Assume a stable causal VAR with i.i.d. innovations of mean zero and finite positive-definite covariance, and \(Q=\mathbb E(x_tx_t\prime)>0\). The causal process is ergodic. For \(T\) usable dates, we have: \[ \sqrt{T}(\mathbf{b}_i-\beta_i) = \underbrace{\left[\frac{1}{T}\sum_{t=1}^T x_t x_t' \right]^{-1}}_{\overset{p}{\rightarrow} \mathbf{Q}^{-1}} \underbrace{\sqrt{T} \left[\frac{1}{T}\sum_{t=1}^T x_t\varepsilon_{i,t} \right]}_{\overset{d}{\rightarrow} \mathcal{N}(0,\sigma_i^2\mathbf{Q})}, \] where \(\sigma_i^2 = \mathbb{V}ar(\varepsilon_{i,t})\) and where \(\mathbf{Q} = \mbox{plim }\frac{1}{T}\sum_{t=1}^T x_t x_t'\) has blocks \[\begin{equation} Q_{00}=1,\qquad Q_{0j}=\mu',\qquad Q_{i0}=\mu,\qquad Q_{ij}=\gamma_{j-i}+\mu\mu',\quad 1\le i,j\le p. \tag{1.14} \end{equation}\] Here block zero is the intercept and \(\gamma_j=\operatorname{Cov}(y_t,y_{t-j})\), with \(\gamma_{-j}=\gamma_j'\). The transposes matter because cross-variable lag covariances are generally asymmetric.

Proof. See Appendix 11.3.

Lagged outcomes are predetermined, so \(\mathbb E(x_t\varepsilon_t')=0\), but future rows of the complete design depend on current innovations. Thus full-design strict exogeneity generally fails. Algebraically, \[\begin{equation} b_i=\beta_i+(X'X)^{-1}X'\boldsymbol\varepsilon_i. \tag{1.15} \end{equation}\] A random inverse correlated with the score can create finite-sample bias. Correlation with earlier errors alone does not prove that every coefficient has nonzero bias. Under the conditions of Proposition 1.3, the ergodic LLN and martingale CLT establish consistency and the stated normal limit; covariance stationarity alone would not suffice.

The next proposition extends Proposition 1.3 by incorporating the covariances between different \(\beta_i\)’s and by characterizing the asymptotic distribution of the ML estimator of \(\Omega\). In other words, it delivers the full asymptotic distribution of the model parameters. This result is particularly useful for Monte Carlo procedures that require drawing from this asymptotic distribution (see Section 3.1).

Proposition 1.4 (Asymptotic distribution of the OLS estimates) Under the preceding stability and rank conditions, with i.i.d. Gaussian innovations, we have: \[\begin{equation} \sqrt{T}\left[ \begin{array}{c} vec(\hat\Pi - \Pi)\\ vec(\hat\Omega - \Omega) \end{array} \right] \overset{d}{\longrightarrow} \mathcal{N}\left(0, \left[ \begin{array}{cc} \Omega \otimes \mathbf{Q}^{-1} & 0\\ 0 & \Sigma_{22} \end{array} \right]\right), \tag{1.16} \end{equation}\] where the entry of \(\Sigma_{22}\) corresponding to \(\hat\omega_{ij}\) and \(\hat\omega_{kl}\) is \(\omega_{ik}\omega_{jl}+\omega_{il}\omega_{jk}\). For non-Gaussian i.i.d. innovations, fourth cumulants change this covariance, and nonzero third moments can also create a coefficient/covariance cross-block. The displayed Gaussian block-diagonal formula must not be transferred unchanged to that case.

Proof. See, e.g., Hamilton (1994), Appendix of Chapter 11.

In practice, to use the previous proposition (for instance to implement Monte-Carlo simulations), \(\Omega\) is replaced with \(\hat{\Omega}\), \(\mathbf{Q}\) is replaced with \(\hat{\mathbf{Q}} = \frac{1}{T}\sum_{t=1}^T x_t x_t'\) and \(\Sigma\) with the matrix whose components are of the form \(\hat\sigma_{i,l}\hat\sigma_{j,m}+\hat\sigma_{i,m}\hat\sigma_{j,l}\), where the \(\hat\sigma_{i,l}\)’s are the components of \(\hat\Omega\).

1.4.3 Specification tests

After estimating a VAR, it is important to check that the model assumptions hold. In particular, we verify:

  1. Stationarity of the data (often checked before estimation). For integrated variables, even when they are cointegrated, the stationary joint limit displayed above need not apply. Some inference procedures remain valid for selected parameters under additional integration/cointegration conditions; blanket stationary Wald or likelihood references are not justified. In practice, one typically inspects unit-root tests or relies on economic knowledge about integration and cointegration properties. \(\Rightarrow\) Remedy: transform the data to make them stationary (removing deterministic trends, or using differences), or use Vector Error-Correction Models (VECM).

  2. Absence of residual autocorrelation. If residuals are serially correlated, the dynamic specification of the VAR is inadequate (e.g., too few lags). This can invalidate the innovation/regressor orthogonality conditions and lead to inconsistent dynamics and IRFs; the precise consequence depends on the misspecification. \(\Rightarrow\) Remedy: increase the lag length or reconsider the model specification (e.g., adding variables, or transforming the variables).

  3. Homoskedasticity. If residuals exhibit heteroskedasticity, OLS estimates remain consistent under mild conditions, but they are no longer efficient, and standard errors become unreliable in finite samples in particular. If they are based on the asymptotic distribution, confidence intervals for coefficients and impulse responses may be misleading. \(\Rightarrow\) Remedy: use heteroskedasticity-robust covariance estimates or an appropriate wild/dependent bootstrap (ordinary i.i.d. residual resampling is not a general heteroskedasticity remedy; see Chapter 3), or adopt models allowing for time-varying volatility (e.g., VAR-GARCH, stochastic-volatility VAR).

  4. Normality of residuals. Non-normality need not invalidate consistent OLS or its coefficient CLT when the required moments and innovation assumptions hold. It does invalidate the Gaussian joint covariance formula above and can impair finite-sample inference. Confidence bands for impulse responses may be distorted under heavy tails or skewness. \(\Rightarrow\) Remedy: use bootstrap inference for hypothesis testing and IRFs.

Example 1.7 (Bivariate model for Switzerland) In this example, we consider a bivariate model capturing the joint dynamics of Swiss inflation and GDP growth rates.

Code
First.date <- "1980-01-01"
Last.date  <- "2025-01-01"
data <- international[,c("date","CPI_CHE","GDP_CHE")]
data <- data[(data$date >= First.date) & (data$date <= Last.date), ]
data <- data[complete.cases(data),]
Y <- data[,c("CPI_CHE","GDP_CHE")]
par(mfrow=c(1,1));par(plt=c(.1,.95,.15,.95))
plot(data$date,data$CPI_CHE,type="l",lwd=2,las=1,ylim=c(-7,11),
     xlab="",ylab="")
grid()
lines(data$date,data$GDP_CHE,lwd=2,col="grey")
Swiss annual CPI inflation (black) and quarterly real-GDP growth (grey), in arithmetic percent. The two series use different growth horizons.

Figure 1.7: Swiss annual CPI inflation (black) and quarterly real-GDP growth (grey), in arithmetic percent. The two series use different growth horizons.

Code
library(tseries)
## Registered S3 method overwritten by 'quantmod':
##   method            from
##   as.zoo.data.frame zoo
Code
test.adf.Y1  <- adf.test(Y[,1],k=16)$p.value
test.adf.Y2  <- adf.test(Y[,2],k=16)$p.value
test.pp.Y1   <- pp.test(Y[,1])$p.value
test.pp.Y2   <- pp.test(Y[,2])$p.value
## Warning in pp.test(Y[, 2]): p-value smaller than printed p-value
Code
test.kpss.Y1 <- kpss.test(Y[,1])$p.value
## Warning in kpss.test(Y[, 1]): p-value smaller than printed
## p-value
Code
test.kpss.Y2 <- kpss.test(Y[,2])$p.value
## Warning in kpss.test(Y[, 2]): p-value greater than printed
## p-value
Code
test.adf  <- c(test.adf.Y1,test.adf.Y2)
test.pp   <- c(test.pp.Y1,test.pp.Y2)
test.kpss <- c(test.kpss.Y1,test.kpss.Y2)
rbind(test.adf,test.pp,test.kpss)
##               [,1]     [,2]
## test.adf  0.263390 0.039105
## test.pp   0.069724 0.010000
## test.kpss 0.010000 0.100000

Estimate the model parameters for a given lag choice:

Code
p <- 2
estVAR <- VAR(Y, p = p) # estimate the VAR model

Check for residual autocorrelation (Portmanteau test) using the Portmanteau test or the one developed by Breusch (1978) and Godfrey (1978) (a high p-value fails to reject the tested serial-correlation restrictions; it does not prove serial independence):

Code
serial.test(estVAR, lags.pt = 20, type = "PT.asymptotic")
## 
##  Portmanteau Test (asymptotic)
## 
## data:  Residuals of VAR object estVAR
## Chi-squared = 63, df = 72, p-value = 0.77
Code
serial.test(estVAR, lags.bg = 4, type = "BG")
## 
##  Breusch-Godfrey LM test
## 
## data:  Residuals of VAR object estVAR
## Chi-squared = 30.9, df = 16, p-value = 0.014

Let us now test for heteroskedasticity that would take place in the form of ARCH (see Engle (1982)). For that, we can use the arch.test function (a high p-value fails to reject the tested ARCH restrictions):

Code
arch.test(estVAR, lags.multi = 12, multivariate.only = TRUE)
## 
##  ARCH (multivariate)
## 
## data:  Residuals of VAR object estVAR
## Chi-squared = 129, df = 108, p-value = 0.086

Normality test can be performed using function normality.test (a high p-value fails to reject the tested normality restrictions; it does not establish Gaussianity):

Code
normality.test(estVAR)
## $JB
## 
##  JB-Test (multivariate)
## 
## data:  Residuals of VAR object estVAR
## Chi-squared = 2556, df = 4, p-value <2e-16
## 
## 
## $Skewness
## 
##  Skewness only (multivariate)
## 
## data:  Residuals of VAR object estVAR
## Chi-squared = 39.1, df = 2, p-value = 3.2e-09
## 
## 
## $Kurtosis
## 
##  Kurtosis only (multivariate)
## 
## data:  Residuals of VAR object estVAR
## Chi-squared = 2517, df = 2, p-value <2e-16

1.5 Block exogeneity and Granger causality

1.5.1 Block exogeneity

In an unconstrained VAR model, where the coefficient matrices \(\Phi_i\) are full, all lags of all endogenous variables may affect all current endogenous variables. However, in some situations one may suspect causal structures in which a subset of variables influences the others, but not the reverse. In such cases, the VAR can be formulated with block exogeneity restrictions.

Let us partition \(y_t\) into two subvectors \(y^{(1)}_{t}\) (\(n_1 \times 1\)) and \(y^{(2)}_{t}\) (\(n_2 \times 1\)), such that \(y_t' = [{y^{(1)}_{t}}',{y^{(2)}_{t}}']\) and \(n = n_1 + n_2\). Then the VAR(1) representation can be written as \[ \begin{bmatrix} y^{(1)}_{t} \\ y^{(2)}_{t} \end{bmatrix} = \begin{bmatrix} \Phi^{(1,1)} & \Phi^{(1,2)} \\ \Phi^{(2,1)} & \Phi^{(2,2)} \end{bmatrix} \begin{bmatrix} y^{(1)}_{t-1} \\ y^{(2)}_{t-1} \end{bmatrix} + \varepsilon_t. \]

Block exogeneity of \(y^{(2)}_t\) (i.e., \(y^{(2)}_t\) does not respond to past values of \(y^{(1)}_t\)) corresponds to the null hypothesis \[ \Phi^{(2,1)} = 0. \] A regular Gaussian LR test is possible when both models maximize the joint system likelihood on the same sample. The example below instead uses a system Wald test, because equation-by-equation restricted OLS need not maximize that joint likelihood when regressors differ across equations. The same logic extends straightforwardly to a VAR(\(p\)) model by imposing \(\Phi^{(2,1)}_i = 0\) for all \(i = 1,\dots,p\).

Consider a model of the joint dynamics of US and Korean GDP growth and inflation rates. Figure 1.8 shows the data used in the estimation.

Code
library(IdSS) # this package contains the data
library(vars) # this package contains standard VAR estimation tools
names.var <- c("GDP_USA","CPI_USA","GDP_KOR","CPI_KOR")
data <- international[,c("date",names.var)]
data <- data[complete.cases(data),]
Y <- data[,c("GDP_USA","CPI_USA","GDP_KOR","CPI_KOR")]
par(mfrow=c(1,2))
par(plt=c(.15,.95,.15,.8))
plot(data$date,data$GDP_KOR,type="l",lwd=2,las=1,
     main="GDP growth rate (q-o-q)",xlab="",ylab="");grid()
lines(data$date,data$GDP_USA,col="grey",lwd=2,las=1)
plot(data$date,data$CPI_KOR,type="l",lwd=2,las=1,
     main="Inflation (y-o-y)",xlab="",ylab="");grid()
lines(data$date,data$CPI_USA,col="grey",lwd=2,las=1)
Quarterly real-GDP growth and annual CPI inflation for the US and Korea, in arithmetic percent. Black: Korea; grey: US. GDP-growth fields are quarter-on-quarter changes; CPI-inflation fields are changes from a year earlier.

Figure 1.8: Quarterly real-GDP growth and annual CPI inflation for the US and Korea, in arithmetic percent. Black: Korea; grey: US. GDP-growth fields are quarter-on-quarter changes; CPI-inflation fields are changes from a year earlier.

Let us first estimate an unrestricted VAR(\(p\)) model using these data.

Code
p <- 4
estVAR <- VAR(Y, p = p) # estimate the VAR model
L0 <- logLik(estVAR)

Impose that Korean lags do not enter either US equation. The US block is ordered first, so the zero block here is \(\Phi_i^{(1,2)}=0\).

Code
n <- ncol(Y)
restrictions <- matrix(1,n,1+p*n)
for(j in 1:p) restrictions[1:2,(3:4)+n*(j-1)] <- 0
estVARrestr <- vars::restrict(estVAR,method="man",resmat=restrictions)

This restricted OLS fit is useful for comparing dynamics, but its logLik value is not automatically the restricted system maximum. Test the restrictions using the unrestricted coefficient covariance instead:

Code
X <- as.matrix(estVAR$datamat[,-(1:n),drop=FALSE])
coef.matrix <- t(Bcoef(estVAR))
resid.matrix <- residuals(estVAR)
Omega.wald <- crossprod(resid.matrix)/nrow(resid.matrix)
V <- kronecker(Omega.wald,solve(crossprod(X)))

Select the coefficients constrained to zero and form their joint Wald statistic:

Code
indices <- unlist(lapply(1:2,function(i) (i-1)*ncol(X)+which(restrictions[i,]==0)))
b.restricted <- as.vector(coef.matrix)[indices]
Wald <- as.numeric(crossprod(b.restricted,solve(V[indices,indices],b.restricted)))
df <- length(indices)
pvalue <- pchisq(Wald,df=df,lower.tail=FALSE)
c(Wald=Wald,df=df,p.value=pvalue)
##     Wald       df  p.value 
## 16.43309 16.00000  0.42316

Under the maintained stable i.i.d. innovation model and the null, this statistic converges to \(\chi^2_{pn_1n_2}\). The sample p-value is 0.423. A non-rejection does not prove block exogeneity. With conditional heteroskedasticity, a suitable robust system covariance is needed.

Let us compare the IRFs in both models (w/ and w/o block exogeneity). In Figure 1.9, the grey lines correspond to a constrained model, where Korean variables do not affect US ones. (In other words, in the restricted model, US variables are exogenous.) The last two shocks have no impact on US variables because the example combines the dynamic zero block with a Cholesky ordering that places the US first. This is not a general consequence of a lag restriction alone.

Code
# Unrestricted model:
Phi <- Acoef(estVAR)
eps <- residuals(estVAR)
Omega <- crossprod(eps)/nrow(eps) # conditional Gaussian covariance estimate
B <- t(chol(Omega)) # Cholesky decomposition of Omega (lower triangular)
# Restricted model:
Phi_restr <- Acoef(estVARrestr)
eps_restr <- residuals(estVARrestr)
Omega_restr <- crossprod(eps_restr)/nrow(eps_restr)
B_restr <- t(chol(Omega_restr))

par(mfrow = c(n, n))
par(plt = c(.35, .97, .25, .68))
Model <- list(c = c, Phi = Phi, B = B)
for (shock in 1:n) {
  eta0 <- rep(0, n)
  eta0[shock] <- 1
  res.sim <- simul.VAR(c = NaN, Phi, B, nb.sim = 30, indic.IRF = 1,
                       u.shock = eta0)
  res.sim_restr <- simul.VAR(c = NaN, Phi_restr, B_restr, nb.sim = 30,
                             indic.IRF = 1,u.shock = eta0)
  for (variable in 1:n) {
    plot(0:(nrow(res.sim)-1),res.sim[, variable], type = "l", lwd = 2, las = 1,
         ylab = if (variable==1) bquote("Shock "*eta[.(shock)]) else "",xlab="",
         main = ifelse(shock==1,
                       paste("Resp. of ", names.var[variable],sep = ""),""))
    lines(0:(nrow(res.sim_restr)-1),res.sim_restr[, variable], type = "l", lwd = 2,col="grey")
  }
}
Impulse response functions in the context of VAR models depicting the joint dynamics of US and Korean GDP growth and inflation rates. Structural shocks are identified by using the Cholesky decomposition. The grey lines correspond to a constrained model, where Korean variables do not affect US ones. (In other words, in the restricted model, US variables are exogenous.)

Figure 1.9: Impulse response functions in the context of VAR models depicting the joint dynamics of US and Korean GDP growth and inflation rates. Structural shocks are identified by using the Cholesky decomposition. The grey lines correspond to a constrained model, where Korean variables do not affect US ones. (In other words, in the restricted model, US variables are exogenous.)

Finally, let us compute the variance decomposition in both models. Let us start with the unrestricted model:

Code
make.variance.decompo(Phi, B, maxHorizon = 50,
                      names.var = names(Y),mfrow = c(2,2))
Variance decomposition in the context of a VAR model depicting the joint dynamics of US and Korean GDP growth and inflation rates. Structural shocks are identified by using the Cholesky decomposition. The plotted shares are for the unrestricted model with Cholesky ordering (US first).

Figure 1.10: Variance decomposition in the context of a VAR model depicting the joint dynamics of US and Korean GDP growth and inflation rates. Structural shocks are identified by using the Cholesky decomposition. The plotted shares are for the unrestricted model with Cholesky ordering (US first).

Figure 1.11 shows the variance decomposition in the context of the restricted model, that entails block exogeneity:

Code
make.variance.decompo(Phi_restr, B_restr, maxHorizon = 50,
                      names.var = names(Y),mfrow = c(2,2))
Variance decomposition in the context of a VAR model depicting the joint dynamics of US and Korean GDP growth and inflation rates. Structural shocks are identified by using the Cholesky decomposition. The model is constrained in such a way that Korean variables do not affect US ones. (In other words, in this restricted model, US variables are exogenous.)

Figure 1.11: Variance decomposition in the context of a VAR model depicting the joint dynamics of US and Korean GDP growth and inflation rates. Structural shocks are identified by using the Cholesky decomposition. The model is constrained in such a way that Korean variables do not affect US ones. (In other words, in this restricted model, US variables are exogenous.)

1.5.2 Granger Causality

Granger (1969) developed a method to study predictive relationships among variables. Granger causality is relative to the chosen information set and is not, by itself, economic or intervention-based causality. The approach consists in determining whether the past values of \(y_{1,t}\) can help explain the current \(y_{2,t}\) (beyond the information already included in the past values of \(y_{2,t}\)).

Formally, let us denote three information sets: \[\begin{eqnarray*} \mathcal{I}_{1,t} & = & \left\{ y_{1,t},y_{1,t-1},\ldots\right\} \\ \mathcal{I}_{2,t} & = & \left\{ y_{2,t},y_{2,t-1},\ldots\right\} \\ \mathcal{I}_{t} & = & \left\{ y_{1,t},y_{1,t-1},\ldots y_{2,t},y_{2,t-1},\ldots\right\}. \end{eqnarray*}\] We say that \(y_{1,t}\) Granger-causes \(y_{2,t}\) if \[ \mathbb{E}\left[y_{2,t}\mid \mathcal{I}_{2,t-1}\right]\neq \mathbb{E}\left[y_{2,t}\mid \mathcal{I}_{t-1}\right]. \]

To get the intuition behind the testing procedure, consider the following bivariate VAR(\(p\)) process: \[\begin{eqnarray*} y_{1,t} & = & c_1+\Sigma_{i=1}^{p}\Phi_i^{(11)}y_{1,t-i}+\Sigma_{i=1}^{p}\Phi_i^{(12)}y_{2,t-i}+\varepsilon_{1,t}\\ y_{2,t} & = & c_2+\Sigma_{i=1}^{p}\Phi_i^{(21)}y_{1,t-i}+\Sigma_{i=1}^{p}\Phi_i^{(22)}y_{2,t-i}+\varepsilon_{2,t}, \end{eqnarray*}\] where \(\Phi_k^{(ij)}\) denotes the element \((i,j)\) of \(\Phi_k\). Then, \(y_{1,t}\) is said not to Granger-cause \(y_{2,t}\) if \[ \Phi_1^{(21)}=\Phi_2^{(21)}=\ldots=\Phi_p^{(21)}=0. \] The null and alternative hypotheses therefore are: \[ \begin{cases} H_{0}: & \Phi_1^{(21)}=\Phi_2^{(21)}=\ldots=\Phi_p^{(21)}=0\\ H_{1}: & \Phi_1^{(21)}\neq0\mbox{ or }\Phi_2^{(21)}\neq0\mbox{ or}\ldots\Phi_p^{(21)}\neq0.\end{cases} \] The null is a joint restriction on all \(p\) coefficients; separate individual significance tests are not equivalent. Formally, this can be tested using the \(F\)-test or asymptotic chi-square test. The \(F\)-statistic is \[ F=\frac{(RSS-USS)/p}{USS/(T-2p-1)}, \] where RSS is the Restricted sum of squared residuals and USS is the Unrestricted sum of squared residuals. With lagged dependent variables, the familiar \(\mathcal F(p,T-2p-1)\) reference is not an exact finite-sample law. Under the regular stable null, \(pF\) has an asymptotic chi-square reference (see Table 11.4 for the conventional finite-sample approximation).4

The following tests examine the two directional joint nulls at three lags. Their conclusions are conditional on this specification and its innovation assumptions:

Code
grangertest(infl ~ y.gdp.gap,order=3,data=US3var)
## Granger causality test
## 
## Model 1: infl ~ Lags(infl, 1:3) + Lags(y.gdp.gap, 1:3)
## Model 2: infl ~ Lags(infl, 1:3)
##   Res.Df Df    F Pr(>F)   
## 1    214                  
## 2    217 -3 3.98 0.0087 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Code
grangertest(y.gdp.gap ~ infl,order=3,data=US3var)
## Granger causality test
## 
## Model 1: y.gdp.gap ~ Lags(y.gdp.gap, 1:3) + Lags(infl, 1:3)
## Model 2: y.gdp.gap ~ Lags(y.gdp.gap, 1:3)
##   Res.Df Df    F Pr(>F)
## 1    214               
## 2    217 -3 1.55    0.2

References

Breusch, T S. 1978. “Testing for Autocorrelation in Dynamic Linear Models.” Australian Economic Papers 17 (31): 334–55.
Engle, Robert F. 1982. “Autoregressive Conditional Heteroscedasticity with Estimates of the Variance of United Kingdom Inflation.” Econometrica 50 (4): 987–1007.
Godfrey, Leslie G. 1978. “Testing for Higher Order Serial Correlation in Regression Equations When the Regressors Include Lagged Dependent Variables.” Econometrica 46 (6): 1303–10.
Granger, C. W. J. 1969. “Investigating Causal Relations by Econometric Models and Cross-Spectral Methods.” Econometrica 37 (3): 424–38. http://www.jstor.org/stable/1912791.
Hamilton, James Douglas. 1994. Time Series Analysis. Princeton University Press. https://www.worldcat.org/title/time-series-analysis/oclc/1194970663&referer=brief_results.

  1. In that case, res.sim is of dimension nb.sim\(\times n\).↩︎

  2. For VAR models, this information set coincides with \(\{y_t,y_{t-1},\ldots\}\). For VARMA models, it requires fundamentalness: recovery of the shocks from the observation history. The stable-invertibility condition \(\det(\Theta(z))\neq0\) for all \(|z|\le1\) is sufficient, but not necessary, for recovery in the closed linear span.↩︎

  3. The estimation of VARMA models is introduced in Appendix 11.2.↩︎

  4. We have \(pF\underset{T \rightarrow \infty}{\rightarrow}\chi^{2}(p)\).↩︎