File: sw_ch14.inp

package info (click to toggle)
gretl 2022c-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 59,552 kB
  • sloc: ansic: 409,074; sh: 4,449; makefile: 3,222; cpp: 2,777; xml: 599; perl: 364
file content (29 lines) | stat: -rw-r--r-- 656 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Reproduce the illustrative VAR and GARCH in Stock and Watson,
# "Introduction to Econometrics", chapter 14
open sw_ch14.gdt

# set the robust std errors variant used by S and W
set force_hc on
set hc_version 1

series infl = 400 * log(PUNEW/PUNEW(-1))
diff infl 
lags d_infl LHUR
smpl 1962:1 1999:4

# run "automatic" VAR, (see equations 14.5 and 14.6)
var 4 d_infl LHUR const -r

# for comparison, try one equation manually
ols LHUR const d_infl(-1 to -4) LHUR(-1 to -4) -r

# Test for Granger causality of unemployment by inflation
omit d_infl(-1 to -4) --test-only

# GARCH model
garch 1 1 ; d_infl const d_infl(-1 to -4) LHUR(-1 to -4) -r --vcv