Vector Autoregressive Models

Consider here some https://latex.codecogs.com/gif.latex?VAR(1) model,

https://latex.codecogs.com/gif.latex?\begin{bmatrix}Y_{1,t}%20\\%20Y_{2,t}\end{bmatrix}%20=%20\begin{bmatrix}A_{1,1}&A_{1,2}%20\\%20A_{2,1}&A_{2,2}\end{bmatrix}\begin{bmatrix}Y_{1,t-1}%20\\%20Y_{2,t-1}\end{bmatrix}%20+%20\begin{bmatrix}\varepsilon_{1,t}%20\\%20\varepsilon_{2,t}\end{bmatrix}

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

To visualize this point, consider the following time series

https://latex.codecogs.com/gif.latex?\begin{bmatrix}Y_{1,t}%20\\%20Y_{2,t}\end{bmatrix}%20=%20\begin{bmatrix}0.7&0.4%20\\%200.2&0.3\end{bmatrix}\begin{bmatrix}Y_{1,t-1}%20\\%20Y_{2,t-1}\end{bmatrix}%20+%20\begin{bmatrix}\varepsilon_{1,t}%20\\%20\varepsilon_{2,t}\end{bmatrix}

To generate that time series, we need to generate a bivariate white noise, i.e. https://latex.codecogs.com/gif.latex?\text{Var}(\boldsymbol{\varepsilon}_t)=\boldsymbol{\Sigma} (not necessarily a diagonal matrix), and https://latex.codecogs.com/gif.latex?\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

https://latex.codecogs.com/gif.latex?\begin{bmatrix}Y_{1,t}%20\\%20Y_{2,t}\end{bmatrix}%20=%20\begin{bmatrix}0.9&0.1%20\\%200.2&0.8\end{bmatrix}\begin{bmatrix}Y_{1,t-1}%20\\%20Y_{2,t-1}\end{bmatrix}%20+%20\begin{bmatrix}\varepsilon_{1,t}%20\\%20\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

https://latex.codecogs.com/gif.latex?\begin{bmatrix}Y_{1,t}%20\\%20Y_{2,t}\end{bmatrix}%20=Z_t+%20\begin{bmatrix}X_{1,t}%20\\%20X_{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")


OpenEdition suggests that you cite this post as follows:
Arthur Charpentier (March 19, 2015). Vector Autoregressive Models. Freakonometrics. Retrieved September 16, 2024 from https://doi.org/10.58079/ouz7


2 thoughts on “Vector Autoregressive Models”

  1. 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

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.