| 1 |
set verbose off |
| 2 |
include SVAR.gfn |
| 3 |
|
| 4 |
# grab data from AWM |
| 5 |
open AWM.gdt --select="YER PCR ITR" |
| 6 |
|
| 7 |
# transform into logs |
| 8 |
series y = 100 * ln(YER) |
| 9 |
series c = 100 * ln(PCR) |
| 10 |
series i = 100 * ln(ITR) |
| 11 |
list X = c i y |
| 12 |
|
| 13 |
# find best lag via AIC |
| 14 |
var 8 X --lagselect |
| 15 |
p = iminc($test)[4] |
| 16 |
|
| 17 |
# check for the "balanced growth path" hypothesis |
| 18 |
johansen p X |
| 19 |
vecm p 2 X |
| 20 |
restrict |
| 21 |
b[1,1] = -1 |
| 22 |
b[1,2] = 0 |
| 23 |
b[1,3] = 1 |
| 24 |
|
| 25 |
b[2,1] = 0 |
| 26 |
b[2,2] = -1 |
| 27 |
b[2,3] = 1 |
| 28 |
end restrict |
| 29 |
|
| 30 |
# ok, now go for the real thing |
| 31 |
bundle x = SVAR_setup("SVEC", X, const, p) |
| 32 |
matrix b = I(2) | -ones(1,2) |
| 33 |
SVAR_coint(&x, 3, b, {}, 1) |
| 34 |
x.horizon = 40 |
| 35 |
SVAR_restrict(&x, "C", 1, 2, 0) |
| 36 |
|
| 37 |
SVAR_estimate(&x) |
| 38 |
gpbuild Fplots |
| 39 |
loop j = 1..3 |
| 40 |
FEVDplot(&x, j, 2) |
| 41 |
endloop |
| 42 |
end gpbuild |
| 43 |
|
| 44 |
gridplot Fplots --output=display |
| 45 |
|
| 46 |
set stopwatch |
| 47 |
SVAR_boot(&x, 1024, 0.90) |
| 48 |
printf "Elapsed time = %g seconds\n", $stopwatch |
| 49 |
|
| 50 |
gpbuild Iplots |
| 51 |
loop j = 1..3 |
| 52 |
IRFplot(&x, 1, j, 2) |
| 53 |
endloop |
| 54 |
end gpbuild |
| 55 |
|
| 56 |
gridplot Iplots --output=display |