Vector Auto Regression – A beginner’s study

Vector auto regression is a multivariate time series forecasting model.

Like auto regression, in vector auto regression also we model a linear equation based on the previous lag values.

However, in this case, instead of a single value, we have a vector.

Hence the name VAR.

The equation:

Basic Auto regression equation
Var equation

The equation looks confusing. But, if we look at the matrix form, we can be more clear.

The beta matrix represents the coefficient matrix.

Granger’s Causality :

We test whether one time series is a cause of another time series. Let’s understand this with an example.

Let’s say we have two countries Country 1, country 2. Country one is rich and Country 2 is poor. Hypothetically, Country 2 decided to export the same amount of goods that country 1 exported in the previous year. It want’s to imitate the strategy of country 1.

Then, the plot of exports of these countries against time will look something like this:

The second plot is basically a shift of first plot by one lag.

Causality:

If two time series are related like above, then we call it granger’s causality. It is not that country 1 exports are causing country 2 exports in the true sense.

We say, country 1 granger causes country 2.

Interesting right!

Math in Granger’s causality :

  1. Looking at the PACF of country 2 series, we find the best lag and fit an AR equation for that.
  2. Add Country 1 lags (Which lags to choose, in itself is a process) to the above equation. If those come out to be significant, then we say country 1 granger causes country 2.
  3. We run a t-test (individual lags) and an F-test (all the lags together).
  4. Conclusion, if we have any at all lags in our final model, then we conclude that they have Granger’s causality.

Cointegration Test

In economic terms, it means that there is some sort of true relationship between the series or processes.

To understand better let’s say we have two series, just like above. Let’s tweak them a bit. Follow the image below.

In the case 1 above, where there is a sudden slump in the c1 plot, there is no way to multiply c2 with any constant to make them cointegrated. So we cannot actually say that there is a true relationship between C1 and C2.

So, even if the processes are Integrated of the same order say (1) , we can still regress them together when they are cointegrated. ( When the difference is stationary) .

Testing Cointegration : Johansen Test

Like discussed above, if the difference is stationary, then we say the series are cointegrated.

Four ‘variables’ xi are co-integrated if one can find a linear combination of the four variables that are integrated of order zero.

The Null hypothesis: The relationship is significant

After testing for these above tests, along with a stationarity test initially, we go ahead with using VAR model.

Implementation of VAR model is present in my github .

Please find it here:

https://github.com/SreeKavyadurbaka/Time-Series-Forecasting-

Happy Learning! 🙂

Leave a comment

Website Built with WordPress.com.

Up ↑

Design a site like this with WordPress.com
Get started