# Vector Autoregressive Models

Consider here some $VAR(1)$ model,

$\begin{bmatrix}Y_{1,t} \\ Y_{2,t}\end{bmatrix} = \begin{bmatrix}A_{1,1}&A_{1,2} \\ A_{2,1}&A_{2,2}\end{bmatrix}\begin{bmatrix}Y_{1,t-1} \\ Y_{2,t-1}\end{bmatrix} + \begin{bmatrix}\varepsilon_{1,t} \\ \varepsilon_{2,t}\end{bmatrix}$

We’ve seen in class that stationnarity of that time series, in the sense that $\mathbb{E}[\boldsymbol{Y}_t]=\boldsymbol{\mu}$ and $\text{Var}[\boldsymbol{Y}_t,\boldsymbol{Y}_{t-h}]=\boldsymbol{\Gamma}(h)$, was valid if the roots (in $\mathbb{C}$) of the characteristic polyonomial –$P(z)=\text{det}(\mathbb{I}-\boldsymbol{A}z)$ – were outside the unit circle.

To visualize this point, consider the following time series

$\begin{bmatrix}Y_{1,t} \\ Y_{2,t}\end{bmatrix} = \begin{bmatrix}0.7&0.4 \\ 0.2&0.3\end{bmatrix}\begin{bmatrix}Y_{1,t-1} \\ Y_{2,t-1}\end{bmatrix} + \begin{bmatrix}\varepsilon_{1,t} \\ \varepsilon_{2,t}\end{bmatrix}$

To generate that time series, we need to generate a bivariate white noise, i.e. $\text{Var}(\boldsymbol{\varepsilon}_t)=\boldsymbol{\Sigma}$ (not necessarily a diagonal matrix), and $\text{Var}(\boldsymbol{\varepsilon}_t,\boldsymbol{\varepsilon}_{t-h})=\boldsymbol{0}$. For instance

> n=500
> r=0.7
> set.seed(1)
> Z1=rnorm(n)
> Z2=rnorm(n)
> E1=Z1
> E2=r*Z1+sqrt(1-r^2)*Z2

To generate now our time series, use

> A=matrix(c(.7,.2,.4,.3),2,2)
> X1=X2=rep(0,n)
> for(t in 2:n){
+   X1[t]=A[1,1]*X1[t-1]+A[1,2]*X2[t-1]+E1[t]
+   X2[t]=A[2,1]*X1[t-1]+A[2,2]*X2[t-1]+E2[t]
+ }

Here, we have

> plot(X1,type="l",col="red")
> lines(X2,col="blue")

Those two time series seem to be stationnary. And, indeed,

> polyroot(c(1,-sum(diag(A)),det(A)))
[1] 1.18+0i 6.51-0i
> Mod(polyroot(c(1,-sum(diag(A)),det(A))))
[1] 1.18 6.51

The two roots of the characteristic polynomial are outsite the unit circle. Now, what if we consider

$\begin{bmatrix}Y_{1,t} \\ Y_{2,t}\end{bmatrix} = \begin{bmatrix}0.9&0.1 \\ 0.2&0.8\end{bmatrix}\begin{bmatrix}Y_{1,t-1} \\ Y_{2,t-1}\end{bmatrix} + \begin{bmatrix}\varepsilon_{1,t} \\ \varepsilon_{2,t}\end{bmatrix}$

> A=matrix(c(.9,.2,.1,.8),2,2)
> A
[,1] [,2]
[1,]  0.9  0.1
[2,]  0.2  0.8

This time, one of the two roots is exactly on the border of the circle (i.e. there is a unit root here)

> polyroot(c(1,-sum(diag(A)),det(A)))
[1] 1.00+0i 1.43-0i
> Mod(polyroot(c(1,-sum(diag(A)),det(A))))
[1] 1.00 1.43

What our series look like, here?

> X1=X2=rep(0,n)
> for(t in 2:n){
+   X1[t]=A[1,1]*X1[t-1]+A[1,2]*X2[t-1]+E1[t]
+   X2[t]=A[2,1]*X1[t-1]+A[2,2]*X2[t-1]+E2[t]
+ }
> plot(X1,type="l",col="red")
> lines(X2,col="blue")

Here, the two series are integrated. But observe, further more, that those two series are here cointegrated (as defined in class this morning). Indeed, it seems that there is a common factor

$\begin{bmatrix}Y_{1,t} \\ Y_{2,t}\end{bmatrix} =Z_t+ \begin{bmatrix}X_{1,t} \\ X_{2,t}\end{bmatrix}$

and the remaining series are stationary.

> Z=(X1+X2)/2
> plot(Z,type="l")
> plot(X1-Z,type="l",col="red")
> lines(X2-Z,col="blue")

A very different graph would be

> A=matrix(c(1,0,0,1),2,2)
> A
[,1] [,2]
[1,]    1    0
[2,]    0    1
> polyroot(c(1,-sum(diag(A)),det(A)))
[1] 1+0i 1-0i
> Mod(polyroot(c(1,-sum(diag(A)),det(A))))
[1] 1 1

Here, the series would be non-stationary, but here, there is no cointegration (even if there might be simultaneous correlation, because of the white noise)

> plot(X1,type="l",col="red",ylim=c(-20,20))
> lines(X2,col="blue")


## 2 thoughts on “Vector Autoregressive Models”

1. Bruno says:

Hi,

I wanted to know what would happen to a VAR model if there are several cointegrated variables and an impulse. (and how can we interpret the VAR before and after the impulse ? ).

Thankfully, Bruno