Debian Codegraph @

tests/discretionary_policy/Gali_2015_chapter_3.mod

raw
1 /*
2 * This file implements the baseline New Keynesian model of Jordi Galí (2015): Monetary Policy, Inflation,
3 * and the Business Cycle, Princeton University Press, Second Edition, Chapter 3
4 *
5 * THIS MOD-FILE REQUIRES DYNARE 4.5 OR HIGHER
6 *
7 * Notes:
8 * - all model variables are expressed in deviations from steady state, i.e. in contrast to
9 * to the chapter, both the nominal interest rate and natural output are not in log-levels, but rather mean 0
10 *
11 * This implementation was written by Johannes Pfeifer. In case you spot mistakes,
12 * email me at [email protected]
13 *
14 * Please note that the following copyright notice only applies to this Dynare
15 * implementation of the model.
16 */
17
18 /*
19 * Copyright © 2016-20 Johannes Pfeifer
20 * Copyright © 2020 Dynare Team
21 *
22 * This is free software: you can redistribute it and/or modify
23 * it under the terms of the GNU General Public License as published by
24 * the Free Software Foundation, either version 3 of the License, or
25 * (at your option) any later version.
26 *
27 * It is distributed in the hope that it will be useful,
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 * GNU General Public License for more details.
31 *
32 * For a copy of the GNU General Public License,
33 * see <https://www.gnu.org/licenses/>.
34 */
35
36
37 var pi ${\pi}$ (long_name='inflation')
38 y_gap ${\tilde y}$ (long_name='output gap')
39 y_nat ${y^{nat}}$ (long_name='natural output') //(in contrast to the textbook defined in deviation from steady state)
40 y ${y}$ (long_name='output')
41 yhat ${\hat y}$ (long_name='output deviation from steady state')
42 r_nat ${r^{nat}}$ (long_name='natural interest rate')
43 r_real ${r^r}$ (long_name='real interest rate')
44 i ${i}$ (long_name='nominal interrst rate')
45 n ${n}$ (long_name='hours worked')
46 m_real ${m-p}$ (long_name='real money stock')
47 m_growth_ann ${\Delta m}$ (long_name='money growth annualized')
48 m_nominal ${m}$ (long_name='nominal money stock')
49 a ${a}$ (long_name='AR(1) technology shock process')
50 r_real_ann ${r^{r,ann}}$ (long_name='annualized real interest rate')
51 i_ann ${i^{ann}}$ (long_name='annualized nominal interest rate')
52 r_nat_ann ${r^{nat,ann}}$ (long_name='annualized natural interest rate')
53 pi_ann ${\pi^{ann}}$ (long_name='annualized inflation rate')
54 z ${z}$ (long_name='AR(1) preference shock process')
55 p ${p}$ (long_name='price level')
56 w ${w}$ (long_name='nominal wage')
57 c ${c}$ (long_name='consumption')
58 w_real ${\frac{w}{p}}$ (long_name='real wage')
59 mu ${\mu}$ (long_name='markup')
60 mu_hat ${\hat \mu}$ (long_name='markup gap')
61 ;
62
63 varexo eps_a ${\varepsilon_a}$ (long_name='technology shock')
64 eps_z ${\varepsilon_z}$ (long_name='preference shock innovation')
65 ;
66
67 parameters alppha ${\alpha}$ (long_name='capital share')
68 betta ${\beta}$ (long_name='discount factor')
69 rho_a ${\rho_a}$ (long_name='autocorrelation technology shock')
70 rho_z ${\rho_{z}}$ (long_name='autocorrelation monetary demand shock')
71 siggma ${\sigma}$ (long_name='inverse EIS')
72 varphi ${\varphi}$ (long_name='inverse Frisch elasticity')
73 phi_pi ${\phi_{\pi}}$ (long_name='inflation feedback Taylor Rule')
74 phi_y ${\phi_{y}}$ (long_name='output feedback Taylor Rule')
75 eta ${\eta}$ (long_name='semi-elasticity of money demand')
76 epsilon ${\epsilon}$ (long_name='demand elasticity')
77 theta ${\theta}$ (long_name='Calvo parameter')
78 ;
79 %----------------------------------------------------------------
80 % Parametrization, p. 67 and p. 113-115
81 %----------------------------------------------------------------
82 siggma = 1;
83 varphi=5;
84 phi_pi = 1.5;
85 phi_y = 0.125;
86 theta=3/4;
87 rho_z = 0.5;
88 rho_a = 0.9;
89 betta = 0.99;
90 eta =3.77; %footnote 11, p. 115
91 alppha=1/4;
92 epsilon=9;
93
94 %----------------------------------------------------------------
95 % First Order Conditions
96 %----------------------------------------------------------------
97
98 model(linear);
99 //Composite parameters
100 #Omega=(1-alppha)/(1-alppha+alppha*epsilon); %defined on page 60
101 #psi_n_ya=(1+varphi)/(siggma*(1-alppha)+varphi+alppha); %defined on page 62
102 #lambda=(1-theta)*(1-betta*theta)/theta*Omega; %defined on page 61
103 #kappa=lambda*(siggma+(varphi+alppha)/(1-alppha)); %defined on page 63
104 [name='New Keynesian Phillips Curve eq. (22)']
105 pi=betta*pi(+1)+kappa*y_gap;
106 [name='Dynamic IS Curve eq. (23)']
107 y_gap=-1/siggma*(i-pi(+1)-r_nat)+y_gap(+1);
108 [name='Definition natural rate of interest eq. (24)']
109 r_nat=-siggma*psi_n_ya*(1-rho_a)*a+(1-rho_z)*z;
110 [name='Definition real interest rate']
111 r_real=i-pi(+1);
112 [name='Definition natural output, eq. (20)']
113 y_nat=psi_n_ya*a;
114 [name='Definition output gap']
115 y_gap=y-y_nat;
116 [name='TFP shock']
117 a=rho_a*a(-1)+eps_a;
118 [name='Production function (eq. 14)']
119 y=a+(1-alppha)*n;
120 [name='Preference shock, p. 54']
121 z = rho_z*z(-1) - eps_z;
122 [name='Money growth (derived from eq. (4))']
123 m_growth_ann=4*(y-y(-1)-eta*(i-i(-1))+pi);
124 [name='Real money demand (eq. 4)']
125 m_real=y-eta*i;
126 [name='Annualized nominal interest rate']
127 i_ann=4*i;
128 [name='Annualized real interest rate']
129 r_real_ann=4*r_real;
130 [name='Annualized natural interest rate']
131 r_nat_ann=4*r_nat;
132 [name='Annualized inflation']
133 pi_ann=4*pi;
134 [name='Output deviation from steady state']
135 yhat=y-steady_state(y);
136 [name='Definition price level']
137 pi=p-p(-1);
138 [name='resource constraint, eq. (12)']
139 y=c;
140 [name='FOC labor, eq. (2)']
141 w-p=siggma*c+varphi*n;
142 [name='definition real wage']
143 w_real=w-p;
144 [name='definition nominal money stock']
145 m_nominal=m_real+p;
146 [name='average price markup, eq. (18)']
147 mu=-(siggma+(varphi+alppha)/(1-alppha))*y+(1+varphi)/(1-alppha)*a;
148 [name='average price markup, eq. (20)']
149 mu_hat=-(siggma+(varphi+alppha)/(1-alppha))*y_gap;
150 end;
151
152
153 %----------------------------------------------------------------
154 % define shock variances
155 %---------------------------------------------------------------
156 shocks;
157 var eps_a = 0.5^2; //unit shock to preferences
158 end;
159
160 planner_objective 0.5*((siggma+(varphi+alppha)/(1-alppha))*yhat^2+epsilon/0.0215*pi^2)/100;
161 discretionary_policy(instruments=(i),irf=20,planner_discount=betta, periods=0) y_gap pi_ann y n w_real p yhat;
162
163