You are on page 1of 31

In The Name of Allah, The Most Beneficent, The Most Merciful

Econometrics
Lecture 45

Dr. Sayyid Salman Rizavi


Time Series Revisited
ARMA processes
VAR
VECM
Time Series
Definition: Variables recorded over time
Annually
Biannually
Quarterly
Monthly
Daily
2.0e+10

Pakistans Exports from


1991 to 2012 in constant
(2005) US dollars
1.5e+10
1.0e+10
5.0e+09

1990 1995 2000 2005 2010


year
AR (Autoregressive) Process
AR:
Variable depending linearly on its own past values

AR (p) process
= 0 + 1 1 + 2 2 + +

AR (1) process
= 0 + 1 1 +

Stata example: AR (3) model


reg gdp L.gdp L2.gdp L3.gdp
VAR ( Vector Autoregressive) Model
VAR:
multivariate time-series regression of each
dependent variable on lags of itself and on lags of all
the other dependent variables

VAR (1) process for y and z


= 0 + 1 1 + 2 1 +
= 0 + 1 1 + 2 1 +

Stata example: VAR (1) model


tsset time
var gdp exports, lags(1)
If lags are not specified, 2 is the default
VAR ( Vector Autoregressive) Model

For VAR both series should be stationary

Dickey Fuller test can be used to know when


(what level) data is stationary

For Dickey Fuller test we need to know the


appropriate lag (Schwert's rule of thumb can be
used)
VAR ( Vector Autoregressive) Model

Schwerts (1989) rule of thumb


1
= [12. ( )4 ]
100
Where =
[]

In ECM.dta with 30 observations, lags = 8

dfuller Default lag length is zero


VAR ( Vector Autoregressive) Model
dfuller Default lag length is zero
VAR ( Vector Autoregressive) Model
dfuller Default lag length is zero

Imports are, in fact, stationary at second


level
VAR ( Vector Autoregressive) Model
dfuller for random walk with drift

If they follow random walk with drift,


exports and imports are integrated of
order 1
VAR ( Vector Autoregressive) Model
Applying VAR: First determine the optimal lag length
for VAR
The command is varsoc

AIC: Akaike Information Criterion, should


be minimized; suggested lag is ONE
VAR ( Vector Autoregressive) Model
Default lag=2 so we need to specify ONE (suggested by AIC

Sing and
significance,
not the
magnitude, is
important
VAR ( Vector Autoregressive) Model
Post Estimation Test of stability of the model:
eigen values should be less than one
Varstable, graph (after running the model)
Roots of the companion matrix

1
.5
Imaginary

0
-.5
-1

-1 -.5 0 .5 1
Real
ARMA (Autoregressive Moving Average)
ARIMA (Autoregressive Integrated Moving Average)
model
A combination of AR and MA processes
ARMA (p,q) process

= 0 + + 1 1 + 2 2 +
+ 1 1 + 2 2 +
ARMA (1,0) is as AR(1)
ARMA (0,1) is as MA(1)
ARMA (1,1) process
= + 1 1 + 1 1 +

ARIMA (p,I,q): I stands for integrated, I=0 is


stationary
ARIMA in Stata

arima is a maximum likelihood estimation


We are discussing Univariate ARIMA

Stata Example:
We must run arima on a stationary series
Stationary level must be determined

arima gdp, arima (1,1,1)


Same as: arima gdp, ar(1) ma(1)
ARIMA in Stata

arima gdp, arima (1,1,1)


ARIMA Post Estimation Commands in Stata

estat acplot
Estimates autocorrelation and covariances
Parametric autocorrelations of D.gdp
1 with 95% confidence intervals
Autocorrelations

.5
0
-.5

0 5 10 15
lag
ARIMA Post Estimation Commands in Stata

estat aroots
Checks the stability conditions

Inverse roots of ARMA polynomials

1
.5
Imaginary

0
-.5
-1

-1 -.5 0 .5 1
Real

AR roots MA roots
ARIMA Post Estimation Commands in Stata

estat vce
Variance covariance matrix of the estimates
Johansens Test for Cointegration

Johansen's test for cointegration:


Bases on Maximum likelihood estimation
two statistics: eigenvalues and a trace-
statistics.

vecrank is the command in Stata


We use one lag as suggested by varsoc for
VAR model;

vecrank exports imports, lags(1)


Johansens Test for Cointegration

Get the optimum lag


Johansens Test for Cointegration
Using the lag by varsoc, apply the test

Variables are cointegrated


If rank=0; no Cointegration
Vector Error Correction Model
ECM can not be used in complex situations like
more number of non stationary variables

A vector error correction model (VECM) adds


error correction features to a multi-factor model
such as a vector autoregression model.

It is nothing but multivariate specification of ECM

The command in stata is vec


one lag less than that of VAR (differencing)
But Stata will automatically subtract the lag
VEC
Vector error correction model
Syntax:
vec varlist [if] [in] [, options]

Menu:
Statistics > Multivariate time series > Vector error-
correction model (VECM)

Type help vec to seek help for the command


Vector Error Correction Model
This is first part of the result
Vector Error Correction Model
This is the second part of the result
Vector Error Correction Model
This is the third part of the result
Tell about Cointegrating relationships
Vector Error Correction Model
If we use the option alpha, we get the short run
adjustment parameters as well.
This would be in addition to the previous results

It looks like gfcf responds faster than exports in


case of changes or shocks.
Vector Error Correction Model
Post Estimation commands:
like varstable, we have vecstable

Usually eigenvalues should be within the circle


Vector Error Correction Model
Post Estimation: veclmar
Test the autocorrelation of residuals

Conclusion: No autocorrelation
Thank you Very Much

You might also like