| 1 |
var c, y_ro, psi, s, tt, pi_h ${\pi_h}$, mc_ro, i_ro, pi_ro ${\pi_\rho}$, pi_eu, pi_f, y_eu, mc_eu, i_eu, g, a, cp, bnr, gs, as ; |
| 2 |
varexo eps_a, eps_g, eps_cp, eps_s, eps_m $\varepsilon_m$, eps_as, eps_gs, eps_ms; |
| 3 |
parameters alfa, niu, delt, teta_h, teta_f, bet, fi, sigm, h, ro, psi_pi $\psi_\pi$, tetas, rhos, psi_pis, psi_y, psi_deltay, rho_g, rho_a, rho_cp, rho_s, rho_gs, rho_as ; |
| 4 |
|
| 5 |
alfa = 0.425 ; |
| 6 |
bet = 0.99 ; |
| 7 |
|
| 8 |
niu = 0.6 ; |
| 9 |
delt = 0.3 ; |
| 10 |
teta_h = 0.7 ; |
| 11 |
teta_f = 0.7 ; |
| 12 |
fi = 2 ; |
| 13 |
sigm = 0.5 ; |
| 14 |
h = 0.8 ; |
| 15 |
ro = 0.5 ; |
| 16 |
psi_pi = 1.5 ; |
| 17 |
tetas = 0.7 ; |
| 18 |
rhos = 0.5 ; |
| 19 |
psi_pis = 1.5 ; |
| 20 |
psi_y = 0.25 ; |
| 21 |
psi_deltay = 0.25 ; |
| 22 |
rho_g = 0.5 ; |
| 23 |
rho_a = 0.5 ; |
| 24 |
rho_cp = 0.5 ; |
| 25 |
rho_s = 0.5 ; |
| 26 |
rho_gs = 0.5 ; |
| 27 |
rho_as = 0.5 ; |
| 28 |
|
| 29 |
model (linear) ; |
| 30 |
|
| 31 |
// (1) mk clearing condition |
| 32 |
(1-alfa) * c = y_ro - alfa * niu* (2-alfa)* tt - alfa * niu * psi - alfa * y_eu ; |
| 33 |
// (2) terms of trade |
| 34 |
tt - tt(-1) = pi_f - pi_h ; |
| 35 |
// (3) terms of trade, real exchange rate, law of one price gap |
| 36 |
s = psi + (1 - alfa) * tt; |
| 37 |
// (4) domestic producers price setting |
| 38 |
pi_h - delt * pi_h(-1) = (1 - teta_h) * (1- bet * teta_h) / teta_h * mc_ro + bet * ( pi_h(+1) - delt * pi_h) ; |
| 39 |
// (5) domestic real mg costs |
| 40 |
mc_ro = fi * y_ro - (1 + fi) * a + alfa * tt + sigm / (1-h) * (c - h* c(-1)) ; |
| 41 |
// (6) importers price setting |
| 42 |
pi_f - delt * pi_f(-1) = (1 - teta_f) * (1 - bet * teta_f) / teta_f * psi + bet * (pi_f (+1) - delt * pi_f) + cp; |
| 43 |
// (7) complete mk assumption |
| 44 |
c - h * c(-1) = y_eu - h * y_eu(-1) + (1 - h) / sigm * (psi + (1 - alfa) * tt) + g ; |
| 45 |
// (8) domestic inflation |
| 46 |
pi_ro = pi_h + alfa * (tt - tt(-1)) ; |
| 47 |
// (9) UIP |
| 48 |
i_ro - pi_ro(+1) - i_eu + pi_eu(+1) = s(+1) - s + bnr ; |
| 49 |
// (10) domestic monetary policy rule |
| 50 |
i_ro = ro * i_ro(-1) + (1 - ro) * (psi_pi * pi_ro + psi_y * y_ro + psi_deltay * (y_ro - y_ro(-1)) ) + eps_m ; |
| 51 |
// (11) foreign euler equation |
| 52 |
y_eu - h * y_eu(-1) = y_eu(+1) - h * y_eu - (1 - h) / sigm * (i_eu - pi_eu(+1)) + gs - gs(+1) ; |
| 53 |
// (12) foreign producers price setting |
| 54 |
pi_eu = (1 - tetas) * (1 - bet * tetas) / tetas * mc_eu + bet * pi_eu(+1) ; |
| 55 |
// (13) foreign real mg costs |
| 56 |
mc_eu = fi * y_eu - (1 + fi) * as + alfa * tt + sigm / (1-h) * (y_eu - h * y_eu(-1)) ; |
| 57 |
// (14) foreign monetary policy rule |
| 58 |
i_eu = rhos * i_eu(-1) + (1 - rhos) * (psi_pis * pi_eu + psi_y * y_eu) + eps_ms ; |
| 59 |
|
| 60 |
// exogenous processes |
| 61 |
// (15) domestic shock in preferences (demand sh) |
| 62 |
g = rho_g * g(-1) + eps_g ; |
| 63 |
// (16) domestic technological shock (supply sh) |
| 64 |
a = rho_a * a(-1) + eps_a ; |
| 65 |
// (17) exchange rate shock |
| 66 |
bnr = rho_s * bnr(-1) + eps_s ; |
| 67 |
// (18) foreign shock in preferences |
| 68 |
gs = rho_gs * gs(-1) + eps_gs ; |
| 69 |
// (19) foreign technological shock |
| 70 |
as = rho_as * as(-1) + eps_as ; |
| 71 |
// (20) cost-push shock |
| 72 |
cp = rho_cp * cp(-1) + eps_cp ; |
| 73 |
|
| 74 |
end ; |
| 75 |
|
| 76 |
shocks; |
| 77 |
var eps_g; stderr 1 ; |
| 78 |
var eps_a; stderr 1 ; |
| 79 |
var eps_cp; stderr 1 ; |
| 80 |
var eps_s; stderr 1 ; |
| 81 |
var eps_m ; stderr 1 ; |
| 82 |
var eps_gs; stderr 1 ; |
| 83 |
var eps_as; stderr 1 ; |
| 84 |
var eps_ms ; stderr 1 ; |
| 85 |
end ; |
| 86 |
|
| 87 |
/* steady ; |
| 88 |
*/ |
| 89 |
|
| 90 |
check ; |
| 91 |
|
| 92 |
estimated_params ; |
| 93 |
niu, 0.6, 0.01, 0.999 ; |
| 94 |
delt, 0.3, 0.01, 0.999 ; |
| 95 |
teta_h, 0.7, 0.01, 0.999 ; |
| 96 |
teta_f, 0.7, 0.01, 0.999 ; |
| 97 |
fi, 2, 0.01, 5 ; |
| 98 |
sigm, 0.5, 0.01, 0.999 ; |
| 99 |
h, 0.8, 0.01, 0.999 ; |
| 100 |
ro, 0.5, 0.01, 0.999 ; |
| 101 |
psi_pi, 1.4, 0.01, 8 ; |
| 102 |
tetas, 0.6, 0.01, 0.999 ; |
| 103 |
rhos, 0.5, 0.01, 0.999 ; |
| 104 |
psi_pis, 1.4, 0.01, 8 ; |
| 105 |
psi_y, 0.25, 0.01, 0.999 ; |
| 106 |
psi_deltay, 0.25, 0.01, 0.999 ; |
| 107 |
rho_g, 0.3, 0.01, 0.999 ; |
| 108 |
rho_a, 0.3, 0.01, 0.999 ; |
| 109 |
rho_cp, 0.3, 0.01, 0.999 ; |
| 110 |
rho_s, 0.3, 0.01, 0.999 ; |
| 111 |
rho_gs, 0.3, 0.01, 0.999 ; |
| 112 |
rho_as, 0.3, 0.01, 0.999 ; |
| 113 |
|
| 114 |
stderr eps_g, 1, 0.01, 10 ; |
| 115 |
stderr eps_a, 1, 0.01, 10 ; |
| 116 |
stderr eps_cp, 1, 0.01, 10 ; |
| 117 |
stderr eps_s, 1, 0.01, 10 ; |
| 118 |
stderr eps_gs, 1, 0.01, 10 ; |
| 119 |
stderr eps_as, 1, 0.01, 10 ; |
| 120 |
% corr eps_g, eps_a, 0, -1, 1; |
| 121 |
end; |
| 122 |
|
| 123 |
varobs y_ro, pi_ro, i_ro, s, y_eu, pi_eu, i_eu, tt ; |
| 124 |
options_.TeX =1; |
| 125 |
sensitivity (identification=1, nsam = 500, lik_only = 1, morris=2) ; |
| 126 |
|
| 127 |
stoch_simul(order=2,irf=20) y_ro pi_ro i_ro s ; |
| 128 |
//order 1 - impulse response functions are simply the algebraic forward iteration of the model's policy |
| 129 |
//order 2 - impulse response functions will be the result of actual Monte Carlo simulations of future shocks |
| 130 |
//specify sucient periods in IRFs to see the graphs return to steady state |
| 131 |
|
| 132 |
check ; |
| 133 |
|
| 134 |
/* shock_decomposition y_ro ; |
| 135 |
*/ |