Date post: | 21-Apr-2015 |
Category: |
Documents |
Upload: | hasnain0099 |
View: | 239 times |
Download: | 0 times |
PRESENTATION FOR GRADUATE
RESEARCH SEMINAR
Vector Auto Regression and Vector Error
Correction Models
By Muhammad Hasnain Yousaf*
*Student of MS Economics at IBA Karachi Can be reached at [email protected]
TYPE OF DATA
Cross Sectional Data (t=1, N>1)
GDP growth rates of all the countries for 2011
Inflation for 110 countries for 2009 etc
Panel Data (t>1, N>1)
A merger of Cross Sections over time
Mirco Panels, Macro Panels and Pooled Panels (Not
related to today’s presentation)
Time Series (t>30, N≥1)
GDP data for Pakistan from 1970-2011 etc
TIME SERIES ECONOMETRICS-METHODOLOGIES
Univariate TS
ARMA
ARMIA
AR(MA)CH
GAR(MA)CH
Multivariate TS
OLS (or OLS with Dummies)
Error Correction Models
MV with AR
Vector Auto Regression
Structural Vector Auto Regression (SVAR)
Vector Error Correction Models
VECTOR AR- ADVANTAGES
Performs both Multivariate as well as Univariate
Analysis at the same time.
Inspects the variables for both autoregressive as well
as multivariate relationship.
Checks for Direction of Causality
Helps in Forecasting
Helps in determining the impact of Shocks on a
variable
VECTOR AUTO REGRESSION SYSTEM
For example we are given three variables
(suppose Gold Holdings, Reserve Money and
Broad Money), the proposed dVAR system would
be
THINGS TO DO BEFORE PERFORMING VAR
ANALYSIS
Check for stationary
ADF Test
Phillip Perron Test
If the |Zc|>|Zt| or P(Zc)<0.05 in ADF or PP, the
variable is stationary
Unit-Root is the Null hypothesis whereas stationarity
is Alternative (Unit-Root philosophy is not today’s
discussion)
If the Variables are not stationary
Make them stationary either by
Differencing (Mean or w r t lag whichever suits the
purpose)
Applying a de-trending filter
VECTOR ERROR CORRECTION MODEL
VEC is an alternative approach to VAR
Also helps in determining the relationship
between the variables
However with different pre-requisits
VEC- PHILOSOPHY
What is Stationarity?
Three Moments
Mean
Variance
Covariance
If TS is not stationary then we have to calculate
N means
N variances
N-1 Covariance's
Comparative statistics and Regression results would not be
meaningful
VEC- PHILOSOPHY VISUAL DETECTION
1980m
11985m
11990m
11995m
12000m
12005m
1
t
1980m1 1985m1 1990m1 1995m1 2000m1 2005m1t
-1-.
50
.51
1.5
Resid
uals
1980m1 1985m1 1990m1 1995m1 2000m1 2005m1t
Non Stationary Variable Stationary Variable
VEC- PHILOSOPHY
So is stationarity is the necessary condition?
Answer is given in table below
Dependent Variable Independent Variable Suitability for Regression
Stationary Stationary Yes
Stationary Non Stationary No
Non Stationary Stationary No
Non Stationary Non Stationary Check for
Cointegration
VEC- SYSTEM
Yt = α + βxt1 +φx2t+ηx3t +εˆ+μt where ε~I (0)
Here x1,x2 and x3 determine short term
relationships where as ε is the long term relationship
which is determined as
εˆ= Yt- α -βxt1 - φx2t - ηx3t
Furthermore, ε is a mean reverting process
X1,X2 and X3 are co-integrated by an order of
rank “r” (where r=1,2,3,….,n)
r=0 means no co integration.
VAR AND VEC IN STATA
Comprehensive package available for both
methodologies
But for people who are not addicted to STATA
,EViews is more user friendly yet equally
comprehensive tool.
AN EXAMPLE FOR APPLICATION
I will use the unemployment rate for 5 US states
from Jan 1978 to Dec 2003
Tennessee
Missouri
Illinois
Indiana
Arkansas
VECTOR AUTO REGRESSION ANALYSIS
Firstly declare the time variable using tsset
command (the following result will appear)
The visually check for stationary using tsline
command and a nice graph will appear
24
68
10
12
1980m1 1985m1 1990m1 1995m1 2000m1 2005m1t
arkansas illinois
indiana kentucky
missouri tenn
VECTOR AUTO REGRESSION ANALYSIS
Apparently unemployment rates appear to follow
a mean reverting path which is obvious since it is
a cyclical variable than a stock one (discussion on
cyclical and stock variables is also not today’s
agenda). However, we will use tests for
stationarity before making any decision.
VECTOR AUTO REGRESSION ANALYSIS
Stationarity can be checked by using dfuller
(ADF) or pperron (PP) command in stata (I will
use the loop to perform the tests on all variables
at once)
Surprise, Surprise!
None of the variables turned out to be stationary
Next Slides contain results of ADF as well as PP test
VECTOR AUTO REGRESSION ANALYSIS
Now I will difference the variables (again using a
loop)
And again plotting them, another nice looking
graph appears
-2-1
01
2
1980m1 1985m1 1990m1 1995m1 2000m1 2005m1t
darkansas dillinois
dindiana dkentucky
dmissouri dtenn
VECTOR AUTO REGRESSION ANALYSIS
Now running ADF and PP are yielding results favoring stationary
I am excluding the results since they will consume two more slides (which I don’t wana do!)
So since we have made the variable stationary, It’s time to apply the VAR
I will run trivariate VAR on Illinois, Indiana and Missouri
The STATA uses var command to apply VAR methodology to selected variables
var (variable1) (variable2) (variable3), lags(1/n) There is no dependent variable since var usese each one of
these as both dependent and independent variable
n means how much maximum lags do you want (I use 5 for quarterly, 12 for monthly and 2 for annual)
VECTOR AUTO REGRESSION ANALYSIS
var dmissouri dindiana dillinois, lags(1/10) and a
long result will appear
THINGS TO CHECK
The sign and significance of relationships
SELECTION ORDER CRITERION
I ran 10 lags in VAR
But do they yeild better model?
Will use Selection Order Criteria for that
STATA uses varsoc command for that. Running
varsoc command will bring this table up
SELECTION ORDER CRITERION
To select the appropriate lag see where the most
stars are
2 criteria are minimized at 1st lag
2 criteria are minimized at 4th lag
1 criterion is minimized at 9th lag
I will use a conservative approach and use 4 lags in
my VAR structure since uptil 4 lags 4 criteria have
been minimized.
CHECKING STABILITY AND CAUSALITY
Now I will run the VAR till 4th lag and test for
both stability and Causality
STATA uses varstable and vargranger commands
for checking stability and causality respectively.
STABILITY
Since all the roots are contained within the circle,
VAR is stable (use varstable,graph command to
get this sweet li’l graph)-1
-.5
0.5
1
Imagin
ary
-1 -.5 0 .5 1Real
Roots of the companion matrix
AN IMPORTANT PICTURE BEFORE RUNNING
GRANGER CAUSALITY
NOW CHECKING CAUSALITY
Use vargranger command to check granger
causality
Granger causality Wald tests
Equation Excluded chi2 df Prob>chi2
--------------------------------------+---------------------------
Changes in Umeployment in Missouri Changes in Umeployment in Indiana 9.3279 4 0.053
do Changes in Umeployment in Illinois 3.6623 4 0.454
do ALL 16.551 8 0.035
--------------------------------------+---------------------------
Changes in Umeployment in Indiana Changes in Umeployment in Missouri 6.7434 4 0.15
do Changes in Umeployment in Illinois 12.975 4 0.011
do ALL 19.425 8 0.013
--------------------------------------+---------------------------
Changes in Umeployment in Illinois Changes in Umeployment in Missouri 19.416 4 0.001
do Changes in Umeployment in Indiana 18.276 4 0.001
do ALL 42.729 8 0
RESULTS
Changes in unemployment in Indiana are
affected by Changes in unemployment in
Missouri
Changes in unemployment in Illinois are affected
by both changes in unemployment in Indiana and
Changes in unemployment in Missouri
Lets revisit the slide 27 again and see if these
results make sense
IMPULSE RESPONSE FUNCTION
IRF determines the impact of a shock in one
variable on other
Use irf command in STATA (my office STATA does
not store irf files so I cant display the output on given
problem)
Use “irf set result” (result is the file name) to create
an IRF file
Can create both tables and graphs by using
irf table irf, noci
irf graph irf, noci (for graph)
IMPULSE RESPONSE FUNCTION
A demo output in table form would be
FORECASTING
Suppose I want to predict the changes in
umeployment for next two years (24 Months).
STATA uses “fcast” command
fcast compute m1_, step(24)
And then use fcast graph m1_dmissouri
m1_dindiana m1_dillinois to graph the forecasts
FORECASTING
-.4
-.2
0.2
.4
-.5
0.5
-.5
0.5
2004m1 2004m7 2005m1 2005m7 2006m1
2004m1 2004m7 2005m1 2005m7 2006m1
Forecast for dmissouri Forecast for dindiana
Forecast for dillinois
95% CI forecast
VEC MODELS
Lets See if VEC Model give us any different
results.
Stationarity is not necessary in VEC
But Cointegration IS!
A VEC SYSTEM OF THREE VARIABLES
CHECKING FOR COINTEGRATION
Regress the variables (dependent-independent
choice doesn’t make much difference)
Simple Mathod
Use simple “regress” or “reg” command in stata
Predict the residuals
Check for stationarity
Check for autocorrelation
If 1st one is present and second one is absent, the
variables are cointegrated, if not, then they are not
Johansen’s cointegration test
RESIDUAL TESTING
-1-.
50
.51
1.5
Resid
uals
1980m1 1985m1 1990m1 1995m1 2000m1 2005m1t
-1-.
50
.51
1.5
Resid
uals
-1 -.5 0 .5 1 1.5Residuals, L
Residuals Graph Auto-Correlation Graph
RESIDUAL TESTING
RESIDUAL TESTING- RESULTS
Residuals are stationary
Residuals are Autocorrelative
No co-integration
Step to Seeking Confirmation by Johansen’s
cointegration test
JOHANSEN’S COINTEGRATION TEST
STATA uses “vecrank” command
We cannot reject the Null Hypothesis that
Variables are co-integrated by the rank of 2
So a cointegration relationship of rank 2 exists
between the variables
RUNNING VEC IN STATA
Use command « vec missouri indiana illinois,
rank(2) lags(4) »
RUNNING VEC IN STATA
Further taking a restricted view out of output
produced by STATA
INFERENCES
The two speeds of adjustment Messouri are:
α11= -0.079 and 0.041
The first equilbrium relationship is Missouri -
078 Illinois -0.43.
The second is Indiana -1.32 Illinois +2.98
Illinois is affected by both Missouri and Indiana.
But Missouri is not affected by Indiana
RUNNING VEC IN STATA
To check which market is more affected by long
term changes i.e. ce-1and ce-2 add an option of
“alpha” to vec command
ADDITIONAL INFORMATION
We can see that Missouri gets more affected by
long terms changes in umeployment.
Illinois has positive shock from both long-term
adjustment terms.
STABILITY
STATA uses “vecstable” command
VEC imposes a condition of 1 to avoid unstability
You can add “graph” option to command to get this
graph-1
-.5
0.5
1
Imagin
ary
-1 -.5 0 .5 1Real
The VECM specification imposes 1 unit modulus
Roots of the companion matrix
FORECASTING
Again I will use a forecast of 24 months
Commands are the same
34
56
7
24
68
46
81
0
2004m1 2004m7 2005m1 2005m7 2006m1
2004m1 2004m7 2005m1 2005m7 2006m1
Forecast for missouri Forecast for indiana
Forecast for illinois
95% CI forecast
QUESTIONS, COMMENTS, SUGGESTIONS OR
FEEDBACK???
THANK YOU VERY MUCH!