Econometrics I: Multivariate Time Series Econometrics...
Transcript of Econometrics I: Multivariate Time Series Econometrics...
Econometrics I:Multivariate Time Series Econometrics (1)
Dean Fantazzini
Dipartimento di Economia Politica e Metodi Quantitativi
University of Pavia
Overview of the Lecture
1st EViews Session XIII: VAR residual diagnostics
Multivariate Time Series Econometrics (1)
Dean Fantazzini July 2007 2
Overview of the Lecture
1st EViews Session XIII: VAR residual diagnostics
2nd EViews Session XIV: Estimate and forecast VAR
Multivariate Time Series Econometrics (1)
Dean Fantazzini July 2007 2-a
Overview of the Lecture
1st EViews Session XIII: VAR residual diagnostics
2nd EViews Session XIV: Estimate and forecast VAR
3rd EViews Session XV: VAR lag order selection
Multivariate Time Series Econometrics (1)
Dean Fantazzini July 2007 2-b
EViews Session XIII: VAR residual diagnostics
−→ The following program computes residual diagnostics from a VAR. For
the residual correlogram (autocorrelation), EViews only provides the
asymptotic standard error which only depends on the sample size.
’ VAR residual tests
’ replicates Lutkepohl (1991, pp.148-158)
’ 1/10/2000 h last checked 3/25/2004
’change path to program path
%path = @runpath
cd %path
’load workfile
load lut1
’ estimate VAR
smpl 1960:1 1978:4
Multivariate Time Series Econometrics (1)
Dean Fantazzini July 2007 3
EViews Session XIII: VAR residual diagnostics
var1.ls 1 2 y1 y2 y3 @ c
’ residual correlograms (Fig 4.2, p.149)
freeze(fig42) var1.correl(12,graph)
show fig42
’ portmanteau test (p.152)
freeze(tab p152) var1.qstats(12,name=qstat)
show tab p152
’ normality test (p.158)
freeze(tab p158) var1.jbera(factor=chol,name=jbera)
show tab p158
You should get the following results:
Multivariate Time Series Econometrics (1)
Dean Fantazzini July 2007 4
EViews Session XIII: VAR residual diagnostics
Figure 1: Autocorrelation Graphs.
-.3
-.2
-.1
.0
.1
.2
.3
1 2 3 4 5 6 7 8 9 10 11 12
Cor(Y1,Y1(-i))
-.3
-.2
-.1
.0
.1
.2
.3
1 2 3 4 5 6 7 8 9 10 11 12
Cor(Y1,Y2(-i))
-.3
-.2
-.1
.0
.1
.2
.3
1 2 3 4 5 6 7 8 9 10 11 12
Cor(Y1,Y3(-i))
-.3
-.2
-.1
.0
.1
.2
.3
1 2 3 4 5 6 7 8 9 10 11 12
Cor(Y2,Y1(-i))
-.3
-.2
-.1
.0
.1
.2
.3
1 2 3 4 5 6 7 8 9 10 11 12
Cor(Y2,Y2(-i))
-.3
-.2
-.1
.0
.1
.2
.3
1 2 3 4 5 6 7 8 9 10 11 12
Cor(Y2,Y3(-i))
-.3
-.2
-.1
.0
.1
.2
.3
1 2 3 4 5 6 7 8 9 10 11 12
Cor(Y3,Y1(-i))
-.3
-.2
-.1
.0
.1
.2
.3
1 2 3 4 5 6 7 8 9 10 11 12
Cor(Y3,Y2(-i))
-.3
-.2
-.1
.0
.1
.2
.3
1 2 3 4 5 6 7 8 9 10 11 12
Cor(Y3,Y3(-i))
Autocorrelations with 2 Std.Err. Bounds
Multivariate Time Series Econometrics (1)
Dean Fantazzini July 2007 5
EViews Session XIII: VAR residual diagnostics
Table 1: Table p. 152
VAR Residual Portmanteau Tests for Autocorrelations
H0: no residual autocorrelations up to lag h
Date: 04/21/03 Time: 23:39
Sample: 1960:1 1978:4
Included observations: 73
Lags Q-Stat Prob. Adj Q-Stat Prob. df
1 0.920768 NA* 0.933556 NA* NA*
2 2.044941 NA* 2.089396 NA* NA*
3 9.328680 0.4075 9.685295 0.3766 9
4 21.03897 0.2775 22.07444 0.2287 18
5 26.38946 0.4971 27.81836 0.4204 27
6 30.77054 0.7154 32.59177 0.6315 36
7 35.57594 0.8416 37.90683 0.7642 45
8 44.83454 0.8085 48.30495 0.6928 54
9 48.27351 0.9147 52.22752 0.8315 63
10 56.81194 0.9051 62.12126 0.7904 72
11 66.09500 0.8846 73.05132 0.7235 81
12 73.51723 0.8966 81.93365 0.7157 90
*The test is valid only for lags larger than the VAR lag order.
df is degrees of freedom for (approximate) chi-square distribution
Multivariate Time Series Econometrics (1)
Dean Fantazzini July 2007 6
EViews Session XIII: VAR residual diagnostics
Table 2: Table p. 158
VAR Residual Normality Tests
Orthogonalization: Cholesky (Lutkepohl)
H0: residuals are multivariate normal
Component Skewness Chi-sq df Prob.
1 0.119351 0.173310 1 0.6772
2 -0.383159 1.786194 1 0.1814
3 -0.312723 1.189845 1 0.2754
Joint 3.149350 3 0.3692
Component Kurtosis Chi-sq df Prob.
1 3.933079 2.648186 1 0.1037
2 3.739590 1.663770 1 0.1971
3 2.648386 0.376049 1 0.5397
Joint 4.688005 3 0.1961
Component Jarque-Bera df Prob.
1 2.821496 2 0.2440
2 3.449965 2 0.1782
3 1.565894 2 0.4571
Joint 7.837355 6 0.2503
Multivariate Time Series Econometrics (1)
Dean Fantazzini July 2007 7
EViews Session XIV: Estimate and forecast VAR
−→ The following program estimates an unrestricted VAR, creates a
model object out the estimated VAR, and obtains dynamic forecasts from
the VAR by solving the model object.
’ estimate VAR and forecast
’ replicates example in Lutkepohl (1991) pp.70-73, pp.89-91
’ 1/7/2000 h last checked 3/25/2004
’change path to program path
%path = @runpath
cd %path
’ load workfile load lut1
’ estimate VAR
smpl 1960:1 1978:4
var1.ls 1 2 y1 y2 y3 @ c
Multivariate Time Series Econometrics (1)
Dean Fantazzini July 2007 8
EViews Session XIV: Estimate and forecast VAR
’ replicates p.72, (3.2.22) & (3.2.24)
’ note that the variables are ordered differently
freeze(out1) var1.output
show out1
’ make model out of estimated VAR
var1.makemodel(mod1)
’ change sample to forecast period
smpl 1979:1 1980:1
’ solve model to obtain dynamic forecasts
mod1.solve
’ plot actual and forecasts
smpl 1975:1 1980:1
Multivariate Time Series Econometrics (1)
Dean Fantazzini July 2007 9
EViews Session XIV: Estimate and forecast VAR
for !i=1 to var1.@neqn
group gtmp y!i y!i 0
freeze(gra!i) gtmp.line
%gname = %gname + ‘‘gra’’ + @str(!i) + ‘‘ ’’
next
’ merge all graphs into one
freeze(gfcst) %gname
gfcst.options size(8,2)
gfcst.align(1,0.1, 0.5)
gfcst.legend position(0.1,0.1)
’gfcst.scale(left)+zeroline
gfcst.draw( dashline,left,rgb(155,155,155) ) 0.0
show gfcst
Multivariate Time Series Econometrics (1)
Dean Fantazzini July 2007 10
EViews Session XIV: Estimate and forecast VAR
You should get the following results:
Multivariate Time Series Econometrics (1)
Dean Fantazzini July 2007 11
EViews Session XIV: Estimate and forecast VAR
Table 3: Estimation results
Vector Autoregression Estimates
Date: 04/21/03 Time: 23:56
Sample(adjusted): 1960:4 1978:4
Included observations: 73 after adjusting endpoints
Standard errors in ( ) & t-statistics in [ ]
Y1 Y2 Y3
Y1(-1) -0.319631 0.043931 -0.002423
(0.12546) (0.03186) (0.02568)
[-2.54774] [ 1.37891] [-0.09435]
Y1(-2) -0.160551 0.050031 0.033880
(0.12491) (0.03172) (0.02556)
[-1.28537] [ 1.57728] [ 1.32533]
Y2(-1) 0.145989 -0.152732 0.224813
(0.54567) (0.13857) (0.11168)
[ 0.26754] [-1.10220] [ 2.01305]
Y2(-2) 0.114605 0.019166 0.354912
(0.53457) (0.13575) (0.10941)
[ 0.21439] [ 0.14118] [ 3.24398]
Multivariate Time Series Econometrics (1)
Dean Fantazzini July 2007 12
EViews Session XIV: Estimate and forecast VAR
Y3(-1) 0.961219 0.288502 -0.263968
(0.66431) (0.16870) (0.13596)
[ 1.44694] [ 1.71015] [-1.94151]
Y3(-2) 0.934394 -0.010205 -0.022230
(0.66510) (0.16890) (0.13612)
[ 1.40490] [-0.06042] [-0.16331]
C -0.016722 0.015767 0.012926
(0.01723) (0.00437) (0.00353)
[-0.97072] [ 3.60427] [ 3.66629]
R-squared 0.128562 0.114194 0.251282
Adj. R-squared 0.049340 0.033666 0.183217
Sum sq. resids 0.140556 0.009064 0.005887
S.E. equation 0.046148 0.011719 0.009445
F-statistic 1.622807 1.418070 3.691778
Log likelihood 124.6378 224.6938 240.4444
Akaike AIC -3.222954 -5.964214 -6.395737
Schwarz SC -3.003321 -5.744581 -6.176104
Mean dependent 0.018229 0.020283 0.019802
S.D. dependent 0.047330 0.011922 0.010451
Determinant Residual Covariance 1.66E-11
Log Likelihood (d.f. adjusted) 595.2689
Akaike Information Criteria -15.73339
Schwarz Criteria -15.07449
Multivariate Time Series Econometrics (1)
Dean Fantazzini July 2007 13
EViews Session XIV: Estimate and forecast VAR
Figure 2: VAR forecasts.
-.04
.00
.04
.08
.12
1975Q1 1975Q3 1976Q1 1976Q3 1977Q1 1977Q3 1978Q1 1978Q3 1979Q1 1979Q3 1980Q1
Y1 Y1 (Baseline)
-.01
.00
.01
.02
.03
.04
.05
1975Q1 1975Q3 1976Q1 1976Q3 1977Q1 1977Q3 1978Q1 1978Q3 1979Q1 1979Q3 1980Q1
Y2 Y2 (Baseline)
-.01
.00
.01
.02
.03
.04
1975Q1 1975Q3 1976Q1 1976Q3 1977Q1 1977Q3 1978Q1 1978Q3 1979Q1 1979Q3 1980Q1
Y3 Y3 (Baseline)
Multivariate Time Series Econometrics (1)
Dean Fantazzini July 2007 14
EViews Session XV: VAR lag order selection
−→ This program computes various criteria to select the lag order of a VAR. The
results from EViews do not quite match those reported in Lutkepohl (1991,
Tables 4.4 and 4.5). While Table 4.4 reports the standard LR statistics, EViews
reports the modified statistics as explained in the EViews 5 User’s Guide.
The program computes the unmodified LR statistics that exactly replicate those
reported in Table 4.5 by using the log likelihood values stored in the output
matrix returned from the “mname=” option in the laglen command. Note that
the stored log likelihood values do not make a degrees of freedom adjustment to
the residual covariance matrix and will not match those reported in the
estimation output.
The information criteria reported in Table 4.5 do not appear to include the
constant term in the log likelihood. However, even after correcting for the
constant term, we are not able to replicate the values for AIC, HQ, and SC in
Table 4.5. (There appears to be a typo in Table 4.5. The HQ and SC values for
lag order 0 are unlikely to be the same.)
Multivariate Time Series Econometrics (1)
Dean Fantazzini July 2007 15
EViews Session XV: VAR lag order selection
’ VAR lag order selection
’ replicates Lutkepohl (1991) Table 4.4 (p.127) and Table 4.5
(p.130)
’ 1/10/2000 h ’ last checked 3/25/2004
’change path to program path
%path = @runpath
cd %path
’ load workfile
load lut1
’ estimate VAR
smpl 1960:1 1978:4
var1.ls 1 2 y1 y2 y3 @ c
’ lag length criteria
freeze(tab45) var1.laglen(4,vname=vlag,mname=mlag)
Multivariate Time Series Econometrics (1)
Dean Fantazzini July 2007 16
EViews Session XV: VAR lag order selection
show tab45
’ unmodified LR test (exactly replicate Table 4.4, p.127)
’ 1st column: (unmodified) LR statistic
’ 2nd column: p-value
!m = @rows(mlag)-2
matrix(!m,2) tab44
!df = var1.@neqn * var1.@neqn ’ degrees of freedom of test
for !r=!m to 1 step -1
tab44(!r,1) = 2*(mlag(!r+1,1) - mlag(!r,1))
tab44(!r,2) = 1 - @cchisq(tab44(!r,1),!df)
next
show tab44
Multivariate Time Series Econometrics (1)
Dean Fantazzini July 2007 17
EViews Session XV: VAR lag order selection
Table 4: Table 4.5
VAR Lag Order Selection Criteria
Endogenous variables: Y1 Y2 Y3
Exogenous variables: C
Date: 04/22/03 Time: 00:22
Sample: 1960:1 1978:4
Included observations: 71
Lag LogL LR FPE AIC SC HQ
0 564.7842 NA 2.69E-11 -15.82491 -15.72930* -15.78689*
1 576.4087 21.93905 2.50E-11 -15.89884 -15.51641 -15.74676
2 588.8591 22.44588* 2.27E-11* -15.99603* -15.32679 -15.72989
3 591.2373 4.086484 2.75E-11 -15.80950 -14.85344 -15.42931
4 598.4565 11.79471 2.91E-11 -15.75934 -14.51646 -15.26508
* indicates lag order selected by the criterion
LR: sequential modified LR test statistic (each test at 5% level)
FPE: Final prediction error
AIC: Akaike information criterion
SC: Schwarz information criterion
HQ: Hannan-Quinn information criterion
Multivariate Time Series Econometrics (1)
Dean Fantazzini July 2007 18
EViews Session XV: VAR lag order selection
Table 5: Table 4.4
C1 C2
R1 23.24884 0.005661
R2 24.90090 0.003083
R3 4.756399 0.855006
R4 14.43835 0.107564
Multivariate Time Series Econometrics (1)
Dean Fantazzini July 2007 19