Debian Codegraph @

addons/SVAR/examples/Traditional/IS-LM.inp

raw
1 ### This script reproduces example 4.7.1 in Lütkepohl and
2 ### Krätzig (2004), "Applied Time Series Econometrics".
3
4
5 set verbose off
6 include SVAR.gfn
7 open IS-LM.gdt --frompkg=SVAR
8
9 set seed 1234
10
11 list X = q i m
12 list Z = const time
13
14 ISLM = SVAR_setup("AB", X, Z, 4)
15 ISLM.horizon = 48
16
17 ### specify restrictions via pattern matrices
18
19 matrix Arest = {1, NA, 0; NA, 1, NA; 0, 0, 1}
20 SVAR_restrict(&ISLM, "A", Arest)
21 matrix Brest = {NA, 0, 0; 0, NA, 0; 0, 0, NA}
22 SVAR_restrict(&ISLM, "B", Brest)
23 ISLM.snames = strsplit("eIS eLM eMS")
24
25 SVAR_estimate(&ISLM)
26
27 printf "Estimated contemporaneous impact matrix (x100) =\n%10.6f", \
28 100 * ISLM.C
29
30 set stopwatch
31 rej = SVAR_boot(&ISLM, 2000, 0.95)
32 printf "Elapsed time = %g\n", $stopwatch
33
34 gpbuild Page185
35 loop col = 1 .. 3
36 loop row = 1 .. 3
37 IRFplot(&ISLM, row, col, 0)
38 endloop
39 endloop
40 end gpbuild
41
42 gridplot Page185 --output=display