Eviews VAR Stata

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

lOMoARcPSD|40950070

Notes on VAR model

Foundation Economics (The University of the South Pacific)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by dimpy kumar (samridhivig@gmail.com)
lOMoARcPSD|40950070

Notes on VAR and VECM model

Estimating VAR model

 Autoregressive: presence of lagged values of the dependent variable on the right hand side of
the equation.
 Vector: system contains a vector of two or more variables.
 Var model is constructed only if the variables are integrated of order one. That is, stationary
after first difference.
 If variables are cointegrated, construct both short run (VAR) and long-run (VEC) models.
 If variables are not cointegrated, construct only the short-run (VAR) model.
 All the variables in a VAR system are endogenous; there are no exogenous variables.
 The stochastic error terms are often called impulses, or innovatives or shocks
 The VAR model is estimated by OLS.

Decide on the maximum log length, k (an empirical issue)

 Too many lags: lose degrees of freedom, statistically insignificant coefficient and
multicollinearity
 Too few lags: specification errors
 Choose optimal lags using the information criteria: AIC, SC, HQIC

Interpretation of the short-run coefficient is as in any other linear model; they are ceteris-paribus effects
and inference can be based on the usual OLS standard errors and test statistics

Lnyt     ik11 ln yt i   kj 11 ln kt  j   mk 11 fdirt m  1t

Lnkt     ik11 ln yt i   kj 11 ln kt  j   mk 11 fdirt m  2t

Lnfdirt     ik11 ln yt i   kj 11 ln kt  j   mk 11 fdirt m  3t

Notes

The depedent variable is a function of its lagged values and the lagged values of other variables in the
model.

All variables have qual lags

VAR must be specified in levels, hence VAR in difference is a mis-speficiation!

Downloaded by dimpy kumar (samridhivig@gmail.com)


lOMoARcPSD|40950070

Some reasons for estimating VAR model

 Because there is no cointegration among the variables in the system


 To establish casual relationships
 To stimulate shocks to the system and trace out the effects of shocks on the endogenous
variables
 For forecasting (decomposing shocks to the var system)

Estimating using stata

Step 1: specify the model

Step 2: Time set the application (syntax: tsset)

Step 3: perform stationary test: series must be integrated of order one and not I(2)

Step 4: determine the oprtimal lag length (k) for the model (syntax: varsoc)

Step 5: estimate the VAR model (syntax: var)

Step 6: Perform the diagnostic test (syntax: varlmax, varnorm; varstable)

(autocorreklation, normality, stability)

Example from lab

Step 1 to 3 is performed in previous lab

Downloaded by dimpy kumar (samridhivig@gmail.com)


lOMoARcPSD|40950070

Step 4:

varsoc lny lnk , maxlag(8)

varsoc lny lnk , maxlag(8)

Selection-order criteria

Sample: 1991 - 2012 Number of obs = 22

+---------------------------------------------------------------------------+

|lag | LL LR df p FPE AIC HQIC SBIC |

|----+----------------------------------------------------------------------|

| 0 | 15.408 .001013 -1.21891 -1.19555 -1.11972 |

| 1 | 141.342 251.87 4 0.000 1.6e-08 -12.3038 -12.2337 -12.0062 |

| 2 | 153.203 23.723 4 0.000 7.7e-09 -13.0185 -12.9016 -12.5225 |

| 3 | 161.824 17.241 4 0.002 5.2e-09* -13.4385 -13.275 -12.7442* |

| 4 | 164.89 6.1335 4 0.189 6.0e-09 -13.3537 -13.1434 -12.461 |

| 5 | 168.097 6.4132 4 0.170 7.1e-09 -13.2815 -13.0245 -12.1905 |

| 6 | 173.733 11.272 4 0.024 7.2e-09 -13.4303 -13.1265 -12.1408 |

| 7 | 174.425 1.3849 4 0.847 1.2e-08 -13.1296 -12.7791 -11.6418 |

| 8 | 190.374 31.898* 4 0.000 6.4e-09 -14.2158* -13.8186* -12.5297 |

+---------------------------------------------------------------------------+

Endogenous: lny lnk

Exogenous: _cons

Downloaded by dimpy kumar (samridhivig@gmail.com)


lOMoARcPSD|40950070

var lny lnk , lag(1/3)

Vector autoregression

Sample: 1986 - 2012 Number of obs = 27

Log likelihood = 181.327 AIC = -12.39459

FPE = 1.45e-08 HQIC = -12.1948

Det(Sigma_ml) = 5.03e-09 SBIC = -11.72268

Equation Parms RMSE R-sq chi2 P>chi2

----------------------------------------------------------------

lny 7 .019328 0.9994 44138.21 0.0000

lnk 7 .00745 0.9999 231799.3 0.0000

----------------------------------------------------------------

------------------------------------------------------------------------------

| Coef. Std. Err. z P>|z| [95% Conf. Interval]

-------------+----------------------------------------------------------------

lny |

lny |

L1. | 1.461864 .2391533 6.11 0.000 .9931324 1.930596

L2. | -.9120347 .3403357 -2.68 0.007 -1.57908 -.244989

L3. | .4094963 .1903268 2.15 0.031 .0364625 .78253

lnk |

Downloaded by dimpy kumar (samridhivig@gmail.com)


lOMoARcPSD|40950070

L1. | 1.151222 .6345558 1.81 0.070 -.0924847 2.394928

L2. | -1.66769 .9658909 -1.73 0.084 -3.560802 .2254211

L3. | .5393039 .579346 0.93 0.352 -.5961933 1.674801

_cons | .1307536 .1261795 1.04 0.300 -.1165538 .378061

-------------+----------------------------------------------------------------

lnk |

lny |

L1. | .1717751 .0921758 1.86 0.062 -.0088863 .3524364

L2. | -.0503229 .1311741 -0.38 0.701 -.3074195 .2067737

L3. | -.0180925 .0733569 -0.25 0.805 -.1618693 .1256843

lnk |

L1. | 1.611699 .2445742 6.59 0.000 1.132343 2.091056

L2. | -1.302807 .3722793 -3.50 0.000 -2.032461 -.5731533

L3. | .6194492 .2232949 2.77 0.006 .1817993 1.057099

_cons | -.0767703 .0486329 -1.58 0.114 -.1720889 .0185483

------------------------------------------------------------------------------

Downloaded by dimpy kumar (samridhivig@gmail.com)


lOMoARcPSD|40950070

Autocorrelation test

varlmar, mlag(3)

Lagrange-multiplier test

+--------------------------------------+

| lag | chi2 df Prob > chi2 |

|------+-------------------------------|

| 1 | 4.1027 4 0.39228 |

| 2 | 3.1431 4 0.53418 |

| 3 | 1.3461 4 0.85351 |

+--------------------------------------+

H0: no autocorrelation at lag order

We cannot reject H0

Normality test

varnorm, jbera

Jarque-Bera test

+--------------------------------------------------------+

| Equation | chi2 df Prob > chi2 |

|--------------------+-----------------------------------|

| lny | 3.603 2 0.16506 |

| lnk | 1.080 2 0.58276 |

| ALL | 4.683 4 0.32142 |

+--------------------------------------------------------+

Downloaded by dimpy kumar (samridhivig@gmail.com)


lOMoARcPSD|40950070

Stability test

varstable

Eigenvalue stability condition

+----------------------------------------+

| Eigenvalue | Modulus |

|--------------------------+-------------|

| .9743759 + .00647285i | .974397 |

| .9743759 - .00647285i | .974397 |

| .4669608 + .557771i | .727434 |

| .4669608 - .557771i | .727434 |

| .09544506 + .7177743i | .724092 |

| .09544506 - .7177743i | .724092 |

+----------------------------------------+

All the eigenvalues lie inside the unit circle.

VAR satisfies stability condition.

VECM model

Specifying VECR model

Lnyt     ik111 ln yt i   kj 111 ln kt  j   mk 111fdirt m  1ECTt 1  1t

Lnyt     ik111 ln kt i   kj 111 ln kt  j   mk 111fdirt m  2 ECTt 1  2t

Lnyt     ik111fdirt i   kj 111 ln kt  j   mk 111fdirt m  3 ECTt 1  3t

k-1 : lag length reduced by 1

Downloaded by dimpy kumar (samridhivig@gmail.com)


lOMoARcPSD|40950070

i ,  j , m = short-run dynamic coefficient of the model’s adjustment long-run equilibrium

 i = speed of adjustment parameter with negative sign

ECTt-1= the error correction term is the lagged value of the residuals obtained from the cointegrating
regression of the dependent variable on the regressions. Contains long-run information derived from
the long run cointegrating relationship.

Uit = residual (error term)

Basic steps in stata

Step 1: Specify the model

Step 2: Prepare stata

Step3: stationary test

Step 4: Determine optimal lag length (p) for the model

Step5: Perform Johansen cointegration test with (p) lags

Step 6: no cointegration, estimate the unrestricted VAR model

Step 7: with cointegration, specify the VECM with (P) lags but the model is estimated with (p-1) lags

Step 8: perform some diagnostic test

Downloaded by dimpy kumar (samridhivig@gmail.com)


lOMoARcPSD|40950070

Johensen

Statistics…multivariate time series…cointegrating rank of a VECM

List all the variable lny first followed by others

Downloaded by dimpy kumar (samridhivig@gmail.com)


lOMoARcPSD|40950070

Downloaded by dimpy kumar (samridhivig@gmail.com)


lOMoARcPSD|40950070

vecrank lny lnk, trend(constant) lags(3)

Johansen tests for cointegration

Trend: constant Number of obs = 27

Sample: 1986 - 2012 Lags = 3

-------------------------------------------------------------------------------

5%

maximum trace critical

rank parms LL eigenvalue statistic value

0 10 170.07089 . 22.5122 15.41

1 13 181.28294 0.56418 0.0881* 3.76

2 14 181.327 0.00326

Because there is cointegration move to step 7

Statistics…multivariate time series…vector error correction model

Downloaded by dimpy kumar (samridhivig@gmail.com)


lOMoARcPSD|40950070

Downloaded by dimpy kumar (samridhivig@gmail.com)


lOMoARcPSD|40950070

vec lny lnk, trend(constant) lags(3)

Vector error-correction model

Sample: 1986 - 2012 Number of obs = 27

AIC = -12.4654

Log likelihood = 181.2829 HQIC = -12.27988

Det(Sigma_ml) = 5.05e-09 SBIC = -11.84148

Equation Parms RMSE R-sq chi2 P>chi2

----------------------------------------------------------------

D_lny 6 .018893 0.9640 561.9516 0.0000

D_lnk 6 .007278 0.9932 3076.858 0.0000

----------------------------------------------------------------

------------------------------------------------------------------------------

| Coef. Std. Err. z P>|z| [95% Conf. Interval]

-------------+----------------------------------------------------------------

D_lny |

_ce1 |

L1. | -.0456805 .0865745 -0.53 0.598 -.2153633 .1240024

lny |

LD. | .5114853 .238614 2.14 0.032 .0438104 .9791603

L2D. | -.4147788 .2152039 -1.93 0.054 -.8365707 .0070131

Downloaded by dimpy kumar (samridhivig@gmail.com)


lOMoARcPSD|40950070

lnk |

LD. | 1.100494 .6825257 1.61 0.107 -.237232 2.43822

L2D. | -.5438264 .6577488 -0.83 0.408 -1.83299 .7453376

_cons | .0519746 .0167944 3.09 0.002 .0190582 .0848909

-------------+----------------------------------------------------------------

D_lnk |

_ce1 |

L1. | .101788 .0333499 3.05 0.002 .0364234 .1671527

lny |

LD. | .0712242 .0919181 0.77 0.438 -.108932 .2513803

L2D. | .0164342 .0829001 0.20 0.843 -.146047 .1789154

lnk |

LD. | .6746017 .2629202 2.57 0.010 .1592876 1.189916

L2D. | -.620869 .2533757 -2.45 0.014 -1.117476 -.1242616

_cons | .0233252 .0064695 3.61 0.000 .0106453 .0360051

------------------------------------------------------------------------------

Cointegrating equations

Equation Parms chi2 P>chi2

Downloaded by dimpy kumar (samridhivig@gmail.com)


lOMoARcPSD|40950070

-------------------------------------------

_ce1 1 292.7353 0.0000

-------------------------------------------

Identification: beta is exactly identified

Johansen normalization restriction imposed

------------------------------------------------------------------------------

beta | Coef. Std. Err. z P>|z| [95% Conf. Interval]

-------------+----------------------------------------------------------------

_ce1 |

lny | 1 . . . . .

lnk | -.6787939 .0396735 -17.11 0.000 -.7565525 -.6010353

_cons | -1.0749 . . . . .

Main output

Johansen normalization restriction imposed

beta | Coef. Std. Err. z P>|z| [95% Conf. Interval]

-------------+----------------------------------------------------------------

_ce1 |

lny | 1 . . . . .

lnk | -.6787939 .0396735 -17.11 0.000 -.7565525 -.6010353

_cons | -1.0749 . . . . .

Downloaded by dimpy kumar (samridhivig@gmail.com)


lOMoARcPSD|40950070

Notes

Lny is position as the dependent variable

The signs of the coefficient are reversed in the long run

Interpretation: In the longrun lnk has a positive impact on GDP.

ECTt 1  { yt 1  j X t 1  m Rt 1} , the cointegrating equation and long-run model

ECTt 1  {1.00ln y  0.678ln kt 1 1.0749}

yt     ik11i yt 1   ik11 iX t  j   mk 11Rt m   ECTt 1  ut

Lny as the target variable

 ln y  0.05  0.5 ln yt 1  0.41 ln yt 2  1.1 ln kt 1  0.5 ln kt 2  0.045ECTt 1  ut

The adjustment term is (0.045), suggesting that previous year’s errors (or deviation from long run
equilibrium) are corrected for with the current year at a convergence speed of 4.5%. However ECTt-1 is
insignificant.

Diagnostic

Statistics…multivariate time series…Vec/VAR diagnostic

Autocorrelation, since we using three lag, maximum order of autocorrelation will be 3

Downloaded by dimpy kumar (samridhivig@gmail.com)

You might also like