1. Trang chủ
  2. » Thể loại khác

VAR and SVAR WITH STATA

69 9 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Introduction to VARs and Structural VARs: Estimation & Tests Using Stata
Tác giả Avichai Snir
Trường học Bar-Ilan University
Thể loại thesis
Năm xuất bản 2009
Định dạng
Số trang 69
Dung lượng 422,7 KB
File đính kèm 124. VAR AND SVA.rar (369 KB)

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Declare: Time Series• Define and format: time variable – datevar_name,”dmy” or – Quarterlyvar_name, “yq” – format: format var_name %d • Declare database as time series – Menu: statistics

Trang 1

Introduction to VARs and Structural VARs:

Estimation & Tests Using Stata

Bar-Ilan University 26/5/2009

Avichai Snir

Trang 2

Background: VAR

• Background:

• Structural simultaneous equations

– Lack of Fit with the data

Trang 3

Simple VAR: Sims (1980)

• Symmetric

– Lags of the dependent variables

– Same Number of Lags

t t

t t

t t

t t

t t

t t

t t

t t

t t

t t

t t

t t

y y

y y

y y

y

y y

y y

y y

y

y y

y y

y y

y

, 3 2

, 3 3 2

, 2 2 2

, 1 4 1

, 3 3 1

, 2 2 1

, 1 1 0

,

31

, 2 2

, 3 3 2

, 2 2 2

, 1 4 1

, 3 3 1

, 2 2 1

, 1 1 0

,

2

, 1 2

, 3 3 2

, 2 2 2

, 1 4 1

, 3 3 1

, 2 2 1

, 1 1 0

γ γ

γ γ

γ γ

ε β

β β

β β

β β

ε α

α α

α α

α α

+ + +

+ +

+ +

+

=

+ + +

+ +

+ +

+

=

+ + +

+ +

+ +

t if

Trang 4

Simple VAR: Matrix Form

• In Matrix Form:

• is a vector of the Dependent Variables

• is a Matrix of Coefficients

• is a Matrix in Lagged Variables

• is a Vector of White Noise Errors

• is a Matrix of exogenous variables (constant,…)

( )

t t

t t

y I

y y

y

ε

ε α

+ Α

= Γ

+ +

Γ + Γ

+

L

Simply or

1 1

Trang 5

0

0 0

0

0

0 0

: :

: :

0 0

0 0

0

0

0 0

0 0

: :

: :

0 0

0 0

0 0

0

0

0 0

0

0

0 0

: : :

3 , 3 2

, 3 1

, 3

3 , 3 2

, 3 1

,

3

3 , 2 1

, 2

3 , 2 2

, 2 1

, 2

2 , 2 1

,

2

1 , 1

3 , 1 2

, 1 1

, 1

3 , 1 2

, 1 1

,

1

3 , 3 2 , 3 1 , 3 3

, 2 2

, 2 1 , 2 3

, 1 2 , 1 1 , 1

1 , 1

2 , 3

1 , 3

1 , 2

2 , 2

1 , 2

3 , 1

2 , 1

1 , 1

σ σ

σ

σ σ

σ

σ σ

σ σ

σ

σ σ

σ

σ σ

σ

σ σ

σ

ε ε

ε ε

ε ε

ε ε

ε

ε ε ε

ε ε ε

ε ε ε

'

ε

ε t t

Covariance Matrix

Trang 6

Contemporary Variance Matrix

3 , 3 2

, 3 1

, 3

3 , 2 2

, 2 1

, 2

3 , 1 2

, 1 1

, 1

σ σ

σ

σ σ

σ

σ σ

σ

Trang 7

Issues Before Estimation

Trang 8

Testing Stationarity

• We have data on Canada 1966Q1-2002Q1

– GDP

– Consumer Price Index (CPI)

– Household Consumption (consumption)

1966Q3

65.47 18.41

38.46

1966Q2

64.58 18.24

37.47

1966Q1

62.53 18.04

36.91

Descriptor GDP

CPI Consumption

Trang 9

Declare: Time Series

• Define and format: time variable

– date(var_name,”dmy”) or

– Quarterly(var_name, “yq”)

– format: format var_name %d

• Declare database as time series

– Menu: statistics    time series    setup & utilities   declare dataset to be time series data

Trang 10

Declaring Time series

Trang 11

Declare Time Series

Trang 12

• Convenience

• Differences are in percentage

Trang 13

• Menu: Graphics  easy graphs  line graph

• Follow the wizard…

Trang 17

• Data don’t look stationary

• Formal test required

• Common tests (Greene, 636-646):

Trang 18

• Choose a test and follow the menu

– Augmented Dickey Fuller

– DF-GLS for a Unit root

– Phillips-Peron unit root

Trang 19

Choosing a test

Trang 20

Running a Test

• Augmented Dickey-Fuller Test

– 6 lags

– Including Trend

Trang 21

• Cannot reject the null at 5%

Trang 22

Create First Differences

• Cannot Reject Unit root: Data is I(1)

Trang 23

Check the new graphs

Trang 26

Is it stationary now? (PP test)

The differenced data seems to be stationary

Trang 27

– Test if the restricted model is significantly

outperformed by the non restricted model

),

|(

),

, ,,

|( yt yt−1 yt−2 xt −1 xt−2 = E yt yt−1 yt−2

E

Trang 28

Granger Test

• Run simple VAR between the variables of interest

• Choose

– Variables

– Lag Length

Trang 29

Granger Test: Running VAR

Trang 30

Testing in Stata

Granger causality test

Trang 31

Granger Test

• Choose variables

Trang 32

Granger Test: Results

• We can reject that Inflation Granger Cause

Household Consumption

• We cannot reject that Household Consumption Granger Cause Inflation

Trang 33

Optimal Lag Length

• Sometimes, we have theory to guide us

• Often, we do not

– Likelihood Ratio Test (LR)

– Akaike Information Criterion

– Bayesian (Schwartz) Information Criterion

Trang 34

Likelihood Ratio (LR) test

General to simple approach: Run VAR with p lags Use the LR test If the test rejects the null, then stop Otherwise run p-1 lags and compare with p-2…

equations of

Number M

matrix ariance

ed unrestrict

W

matrix ariance

restricted W

M W

W T

unres

res

unresres

ln

λ

Trang 35

Information Criteria

• Two information Criteria: Akaike (AIC) and Bayesian (BIC) Find the information criteria for lag length 1 to p Choose the lag length that minimizes the information criteria that you chose

,,

2)

(

,

,,

cov

)()

(

|)ln(|

2

BICfor

TAICfor

T

IC

equationsof

numberM

nsobservatioof

number

T

lagsof

numberp

Matrixariance

The

W

T

TICM

pMW

=

λ

Trang 36

Tests in Stata

Lag-Order Selection statistics

Trang 37

Running test

• Choose Variables

• Choose maximum lags

Trang 38

Lag Length: Results

We go with the LR and AIC and say 6

(why not?)

Trang 39

Run Simple VAR

• We run a simple VAR (not structural, no assumptions on order of variables)

between Household Consumption,

Inflation and GDP

• To do so:

series  Basic Vector

Autoregression Model

Trang 40

Simple VAR

• Choose

– Variables

– Lag Length

• Choose how to plot the response functions:

– Irf (simply uses the covariance matrix, minimum order)

– Orf (orthogonalized the Covariance matrix to set order)

– FEVD: Variance Decomposition Tables (In a

graph form)

Trang 41

Simple VAR

Trang 42

Results: Table of Coefficients

Trang 43

Impulse Response Function

v arbas ic , dc ons , dc ons v arbas ic , dc ons , inf lat ion v arbas ic , dc ons , y

v arbas ic , inf lat ion, dc ons v arbas ic , inf lat ion, inf lat ion v arbas ic , inf lat ion, y

v arbas ic , y , dc ons v arbas ic , y , inf lat ion v arbas ic , y , y

95% CI orthogonali zed irf

s tep

Graphs by irf name, impuls e v ariable, and res pons e v ariable

Trang 44

Simple VAR: Variance Decomposition Table

Trang 45

Generating After Estimation

• generate after estimation:

Trang 46

To get the results

• If you want to use some of the results:

• Coefficients

• Number of observations

• Etc…

– Stata keeps them under the ereturn command

– To get them type e(variable_name)

– To see all the variables that you can choose from:

• ereturn list

Trang 47

Examples

Trang 48

More than simple VAR

• More than a simple VAR:

– Adding Exogenous Variables

– Constraining blocks of variables to equal zero

• Use Menu: Statistics  multivariate

time series   Vector Autoregression Model

• Generating Impulse Responses:

IRF & Variance Decomposition Analysis

Trang 49

More than simple VAR

• Adding constraints on the A or B matrix

– A: y Matrix, B: errors matrix

– Short and long run constraints

• skip lags

Structural Autoregression Model

• Stata runs the VAR with the restrictions

• Caveat 1: Too many constraints can lead to failures in the convergence process

• Caveat 2: You need enough constraints to

Trang 51

Structural VAR: Results

Trang 52

Structural VAR: Results

v arbas ic , dc ons , dc ons v arbas ic , dc ons , inf lat ion v arbas ic , dc ons , y

v arbas ic , inf lat ion, dc ons v arbas ic , inf lat ion, inf lat ion v arbas ic , inf lat ion, y

v arbas ic , y , dc ons v arbas ic , y , inf lat ion v arbas ic , y , y

95% CI orthogonali zed irf

s tep

Graphs by irf name, impuls e v ariable, and res pons e v ariable

Trang 53

Structural VARs

• Structural VAR: VAR that is the result

of a structural model

• Goal: Obtaining the Structural

parameters out of the Estimated

Reduced Form

• Required: Number of Constraints

Trang 54

Model: Inflation and GDP

• Assume we have a simple model of the

form:

iables random

t independen noise

White

lation

GDP y

y y

y y

t t

t t

t t

t t

t

t t

t t

var ,

,

inf

1 3

2 1

0

1 2

1 1

+ +

=

+ +

β β

β β

π

ε π

α α

α

Trang 55

We can write it:

t t

t t

t

t t

t

t

y y

y

y

υ π

β β

β β

π

ε π

α α

α

+ +

+

=

+ +

2 0

1

1 2

1 1

0

Trang 56

t t

β

α π

1 0

0

1 1

0 1

t t

π β

β

α β

π

1

1 1

1 1

1 0

0 1

0 1

1

0 1

1 0 1

Trang 57

Inverting the Matrix gives

0 1

Trang 58

We find:

( ) ( ) t ( ) t ( t t )

t

t t

t t

y

y

y

υ ε

β π

β α

β β

α β β

α β

π

ε π

α α

α

+ +

+ +

+ +

+

=

+ +

3 2

1 1

2 1

1 0

0 1

1 2

1 1

0

So we can write in VAR form:

t t

t t

t t

θ θ

θ π

ε π

α α

α

+ +

+

=

+ +

1 1

0

1 2

1 1

0

Trang 59

0 1

θ β

α β

θ β

α β

θ β

α β

= +

= +

= +

So we have three equations and four unknowns…

Trang 60

Hakuna Matata

• We also have the covariance matrix:

• So we have a fourth equation:

1 ,

1

, 1

, ,

,

, ,

t

υ σ

β σ

β

σ β

σ σ

σ

σ

σ

ε ε ε

ε

ε ε ε

ε η

η η

ε

η ε ε

ε

η ε

ε

σ

Trang 61

Run the VAR

• Note that because we assume that the “real”

covariance matrix has the triangular form:

• We can use the OIRF that Stata gives us (Cholesky factorization) to watch the Structural impulse

ε

ε

ε

σ σ

β

σ

, ,

1

Trang 62

Run the VAR (1 lag)

Trang 63

Study the Impulse Responses

Trang 64

Get the coefficients

0

α2α

0

θ

Trang 65

Get the Errors matrix

ε

ε

σ ,

ε ε

σ

β1 ,

Trang 66

We find:

614

0 142

0 086

0 625

0

142

0 622

0 086

0 195

0

0043

0 0574

0 086

0 0005972

0

086

0 00008145

0

000007018

0 )

, cov(

2 1 2

3

1 1 1

2

0 1 0

0

, 1

β

α β θ

β

α β θ

Trang 68

To test a restricted Model

• Run a non restricted model

• Test the null by using the LR test on the difference between the restricted and

unrestricted model

ns restrictio of

Number M

matrix ariance

ed unrestrict

W

matrix ariance

restricted W

M W

W T

unres

res

unres res

ln

λ

Ngày đăng: 02/09/2021, 21:09

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN