Debian Codegraph @

tests/identification/LindeTrabandt/LindeTrabandt2019_xfail.mod

raw
1 % Original model by: J. Linde, M. Trabandt (2019: Should We Use Linearized Models to Calculate Fiscal Multipliers?
2 % Journal of Applied Econometrics, 2018, 33: 937-965. http://dx.doi.org/10.1002/jae.2641
3 % This version has some additional dynamics for capital and investment
4 % Created by Willi Mutschler (@wmutschl, [email protected])
5 % =========================================================================
6 % Copyright © 2019-2020 Dynare Team
7 %
8 % This file is part of Dynare.
9 %
10 % Dynare is free software: you can redistribute it and/or modify
11 % it under the terms of the GNU General Public License as published by
12 % the Free Software Foundation, either version 3 of the License, or
13 % (at your option) any later version.
14 %
15 % Dynare is distributed in the hope that it will be useful,
16 % but WITHOUT ANY WARRANTY; without even the implied warranty of
17 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 % GNU General Public License for more details.
19 %
20 % You should have received a copy of the GNU General Public License
21 % along with Dynare. If not, see <https://www.gnu.org/licenses/>.
22 % =========================================================================
23 % =========================================================================
24 % Declare endogenous variables
25 % =========================================================================
26
27 var
28 % Staggered-price economy
29 c ${c}$ (long_name='consumption')
30 lam ${\lambda}$ (long_name='lagrange multiplier budget')
31 n ${n}$ (long_name='labor')
32 w ${w}$ (long_name='real wage')
33 r ${r}$ (long_name='interest rate')
34 pie ${\pi}$ (long_name='inflation')
35 y ${y}$ (long_name='output')
36 pstar ${p^\ast}$ (long_name='price dispersion')
37 vartheta ${\vartheta}$ (long_name='aggregate price index')
38 mc ${mc}$ (long_name='marginal costs')
39 s ${s}$ (long_name='auxiliary variable for nonlinear pricing 1')
40 f ${f}$ (long_name='auxiliary variable for nonlinear pricing 2')
41 a ${a}$ (long_name='auxiliary variable for nonlinear pricing 3')
42 ptilde ${\tilde{p}}$ (long_name='reoptimized price')
43 delta1 ${\Delta_1}$ (long_name='price dispersion 1')
44 delta2 ${\Delta_2}$ (long_name='price dispersion 2')
45 delta3 ${\Delta_3}$ (long_name='price dispersion 3')
46 b ${b}$ (long_name='bonds')
47 tau ${\tau}$ (long_name='lump-sum tax')
48 g
49 nu %consumption preference shock
50
51 % Flex-price economy
52 cpot ${c^{pot}}$ (long_name='flex-price consumption')
53 npot ${n^{pot}}$ (long_name='flex-price labor')
54 wpot ${w^{pot}}$ (long_name='flex-price real wage')
55 rrpot ${r^{pot}}$ (long_name='flex-price interest rate')
56 ypot ${y^{pot}}$ (long_name='flex-price output')
57 bpot ${b^{pot}}$ (long_name='flex-price bonds')
58 taupot ${\tau^{pot}}$ (long_name='flex-price lump-sum tax')
59
60 % Added variables for capital and investment
61 k ${k}$ (long_name='capital')
62 rk ${r^{K}}$ (long_name='rental rate on capital')
63 iv ${i}$ (long_name='investment')
64 q ${q}$ (long_name='Tobins Q')
65 kpot ${k^{pot}}$ (long_name='flex-price capital')
66 rkpot ${r^{K,pot}}$ (long_name='flex-price rental rate on capital')
67 ivpot ${i^{pot}}$ (long_name='flex-price investment')
68 ;
69
70 % =========================================================================
71 % Declare observable variables
72 % =========================================================================
73 varobs c y;
74
75 % =========================================================================
76 % Declare exogenous variables
77 % =========================================================================
78 varexo
79 epsg
80 epsnu
81 ;
82
83 % =========================================================================
84 % Declare parameters
85 % =========================================================================
86 parameters
87 ALPHA ${\alpha}$ (long_name='capital share')
88 BETA ${\beta}$ (long_name='discount rate')
89 PIEBAR ${\bar{\pi}}$ (long_name='target inflation rate')
90 IOTA ${\iota}$ (long_name='indexation')
91 CHI ${\chi}$ (long_name='inverse frisch elasticity')
92 THETAP ${\theta_p}$ (long_name='net markup')
93 XIP ${\xi_p}$ (long_name='Calvo probability')
94 PSI ${\psi}$ (long_name='Kimbal curvature')
95 GAMMAPIE ${\gamma_\pi}$ (long_name='Taylor rule parameter inflation')
96 GAMMAX ${\gamma_x}$ (long_name='Taylor rule parameter output')
97 DELTA ${\delta}$ (long_name='depreciation rate')
98 QBAR ${\bar{Q}}$ (long_name='steady state Q')
99 NUBAR ${\bar{\nu}}$ (long_name='steady state consumption preference shock')
100 BBAR %government debt to annualized output ratio
101 GBAR_o_YBAR % government consumption ratio
102 TAUBAR
103 TAUNBAR
104 PHI
105 RHONU
106 RHOG
107 SIGNU
108 SIGG
109 ;
110
111
112 % =========================================================================
113 % Calibration
114 % =========================================================================
115 BETA = 0.995;
116 PIEBAR = 1 + 0.005;
117 ALPHA = 0.3;
118 NUBAR = 0;%0.01;
119 BBAR = 0;%0.6;
120 GBAR_o_YBAR = 0;%0.2;
121 TAUBAR = 0;
122 PHI = 0.0101;
123 IOTA = 0.5;
124 CHI = 1/0.4;
125 XIP = 2/3;
126 PSI = -12.2;
127 THETAP = 0.1;
128 GAMMAPIE = 1.5;
129 GAMMAX = 0.125;
130 QBAR=1;
131 DELTA = 0;%0.025;
132 RHONU = 0.95;
133 RHOG = 0.95;
134 SIGG = 0.6/100;
135 SIGNU = 0.6/100;
136 TAUNBAR = 0;
137
138 % ========================================================================
139 % Model equations
140 % =========================================================================
141 model;
142 % -------------------------------------------------------------------------
143 % Auxiliary expressions
144 % -------------------------------------------------------------------------
145 #OMEGAP = (1+THETAP)*(1+PSI)/(1+PSI+THETAP*PSI); %gross markup
146 #gammap = pie^IOTA*PIEBAR^(1-IOTA); %indexation rule
147 %#gammap = PIEBAR;
148 % -------------------------------------------------------------------------
149 % Added equations for capital and investment
150 % -------------------------------------------------------------------------
151 [name='foc household wrt i']
152 lam = lam*q;
153 [name='foc household wrt k']
154 lam*q = BETA*lam(+1)*(rk(+1)+ (1-DELTA)*q(+1) );
155 [name='capital accumulation']
156 k = (1-DELTA)*k(-1) + iv;
157 [name='capital demand']
158 rk=ALPHA*mc*y/k(-1);
159
160 [name='flex price foc household wrt k']
161 (cpot-steady_state(cpot)*nu)^(-1) = BETA*(cpot(+1)-steady_state(cpot)*nu(+1))^(-1)*(rkpot(+1) + (1-DELTA) );
162 [name='flex price capital accumulation']
163 kpot = (1-DELTA)*kpot(-1) + ivpot;
164 [name='flex price capital demand']
165 rkpot=ALPHA/(1+THETAP)*(npot/kpot(-1))^(1-ALPHA);
166
167 % -------------------------------------------------------------------------
168 % Actual model equations
169 % -------------------------------------------------------------------------
170 [name='foc household wrt c (marginal utility)']
171 (c-steady_state(c)*nu)^(-1) = lam;
172
173 [name='foc household wrt l (leisure vs. labor)']
174 n^CHI = (1-TAUNBAR)*lam*w;
175
176 [name='foc household wrt b (Euler equation)']
177 lam = BETA*r/pie(+1)*lam(+1);
178
179 [name='aggregate resource constraint']
180 y = c + g + iv;
181
182 [name='production function']
183 y=pstar^(-1)*k(-1)^ALPHA*n^(1-ALPHA);
184
185 [name='Nonlinear pricing 1']
186 s = OMEGAP*lam*y*vartheta^(OMEGAP/(OMEGAP-1))*mc + BETA*XIP*(gammap/pie(+1))^(OMEGAP/(1-OMEGAP))*s(+1);
187
188 [name='Nonlinear pricing 2']
189 f = lam*y*vartheta^(OMEGAP/(OMEGAP-1)) + BETA*XIP*(gammap/pie(+1))^(1/(1-OMEGAP))*f(+1);
190
191 [name='Nonlinear pricing 3']
192 a = PSI*(OMEGAP-1)*lam*y + BETA*XIP*(gammap/pie(+1))*a(+1);
193
194 [name='Nonlinear pricing 4']
195 s = f*ptilde -a*ptilde^(1+OMEGAP/(OMEGAP-1));
196
197 [name='zero profit condition']
198 vartheta = 1 + PSI - PSI*delta2;
199
200 [name='aggregate price index']
201 vartheta = delta3;
202
203 [name='overall price dispersion']
204 pstar = 1/(1+PSI)*vartheta^(OMEGAP/(OMEGAP-1))*delta1^(OMEGAP/(1-OMEGAP)) + PSI/(1+PSI);
205
206 [name='price dispersion 1']
207 delta1^(OMEGAP/(1-OMEGAP)) = (1-XIP)*ptilde^(OMEGAP/(1-OMEGAP)) + XIP*(gammap/pie*delta1(-1))^(OMEGAP/(1-OMEGAP));
208
209 [name='price dispersion 2']
210 delta2 = (1-XIP)*ptilde+XIP*gammap/pie*delta2(-1);
211
212 [name='price dispersion 3']
213 delta3^(1/(1-OMEGAP)) = (1-XIP)*ptilde^(1/(1-OMEGAP)) + XIP*(gammap/pie*delta3(-1))^(1/(1-OMEGAP));
214
215 [name='marginal costs']
216 (1-ALPHA)*mc = w*k(-1)^(-ALPHA)*n^ALPHA;
217
218 [name='Taylor Rule']
219 r = steady_state(r)*(pie/PIEBAR)^GAMMAPIE*( (y/steady_state(y))/(ypot/steady_state(ypot)) )^GAMMAX;
220
221 [name='government budget']
222 b = r(-1)/pie*b(-1) + g/steady_state(y) -TAUNBAR*w*n/steady_state(y) - tau;
223
224 [name='fiscal rule']
225 tau = TAUBAR + PHI*(b(-1)-BBAR);
226
227 [name='flex price Euler equation']
228 (cpot-steady_state(cpot)*nu)^(-1) = BETA*rrpot*(cpot(+1)-steady_state(cpot)*nu(+1))^(-1);
229
230 [name='flex price foc household wrt l (leisure vs. labor)']
231 npot^CHI = (1-TAUNBAR)*(cpot-steady_state(cpot)*nu)^(-1)*wpot;
232
233 [name='flex price wage']
234 (1-ALPHA)/(1+THETAP)*kpot(-1)^ALPHA = wpot*npot^ALPHA;
235
236 [name='flex price aggregate resource constraint']
237 ypot = cpot + g + ivpot;
238
239 [name='flex price production function']
240 ypot=kpot(-1)^ALPHA*npot^(1-ALPHA);
241
242 [name='flex price government budget']
243 bpot = rrpot(-1)*bpot(-1) + g/steady_state(y) -TAUNBAR*wpot*npot/steady_state(y) - taupot;
244
245 [name='fiscal rule ']
246 taupot = TAUBAR + PHI*(bpot(-1)-BBAR);
247
248 g/steady_state(y) - GBAR_o_YBAR = RHOG*(g(-1)/steady_state(y) - GBAR_o_YBAR) + epsg;
249 nu - NUBAR = RHONU*(nu(-1) - NUBAR) + epsnu;
250 end;
251
252
253 % =========================================================================
254 % Steady state using a steady_state_model block
255 % =========================================================================
256
257 steady_state_model;
258 OMEGP = (1+THETAP)*(1+PSI)/(1+PSI+THETAP*PSI);
259 q = QBAR;
260 pie = PIEBAR;
261 GAMMAP = PIEBAR^IOTA*PIEBAR^(1-IOTA);
262 b = BBAR;
263 tau = TAUBAR;
264 taun = TAUNBAR;
265 nu = NUBAR;
266 r = pie/BETA;
267 RK = (1/BETA+DELTA-1)*q; % foc k
268 aux1 = ( (1-XIP)/(1-XIP*(GAMMAP/pie)^(1/(1-OMEGP)) ) )^(1-OMEGP);
269 aux2 = (1-XIP)/(1-XIP*(GAMMAP/pie));
270 ptilde = (1+PSI)/ ( aux1 + PSI*aux2 );
271 delta2 = aux2*ptilde;
272 delta3 = aux1*ptilde;
273 vartheta = delta3;
274 delta1 = ( (1-XIP)/(1-XIP*(GAMMAP/pie)^(OMEGP/(1-OMEGP) )) )^((1-OMEGP)/OMEGP)*ptilde;
275 pstar = 1/(1+PSI)*vartheta^(OMEGP/(OMEGP-1))*delta1^(OMEGP/(1-OMEGP)) + PSI/(1+PSI);
276 f_o_a = ( vartheta^(OMEGP/(OMEGP-1)) / (1-BETA*XIP*(GAMMAP/pie)^(1/(1-OMEGP))) ) / ( PSI*(OMEGP-1) /(1-BETA*XIP*GAMMAP/pie) );
277 s_o_a = ( OMEGP*vartheta^(OMEGP/(OMEGP-1)) / (1-BETA*XIP*(GAMMAP/pie)^(OMEGP/(1-OMEGP))) ) / ( PSI*(OMEGP-1) /(1-BETA*XIP*GAMMAP/pie) );
278 mc = (f_o_a*ptilde-ptilde^(1+OMEGP/(OMEGP-1)))*s_o_a^(-1);
279
280 k_o_n = (RK/(mc*ALPHA))^(1/(ALPHA-1));
281 w = (1-ALPHA)*mc*k_o_n^ALPHA; % labor demand
282 y_o_n = pstar^(-1)*k_o_n^ALPHA; % production function
283 iv_o_n = DELTA*k_o_n;
284 iv_o_y = iv_o_n / y_o_n;
285 g_o_y = GBAR_o_YBAR;
286 c_o_n = y_o_n - iv_o_n - g_o_y; % market clearing
287
288 % The labor level, closed-form solution for labor
289 n = (c_o_n^(-1)*w)^(1/(CHI+1)) ;
290 % Value of remaining variables
291 c = c_o_n*n;
292 rk = RK;
293
294
295 iv = iv_o_n *n;
296 k = k_o_n*n;
297 y = y_o_n*n;
298 lam = n^CHI/w;
299 g = g_o_y*y;
300 a = PSI*(OMEGP-1)*y*lam/(1-BETA*XIP*GAMMAP/pie);
301 f = f_o_a*a;
302 s = f*ptilde - a*ptilde^(1+OMEGP/(OMEGP-1));
303
304 %flex price economy
305 bpot = BBAR;
306 taupot = TAUBAR;
307 taun = TAUNBAR;
308
309 rrpot = 1/BETA;
310 RKpot = (1/BETA+DELTA-1)*QBAR; % foc k
311 rkpot = RKpot;
312
313 kpot_o_npot = (RKpot/(ALPHA/(1+THETAP)))^(1/(ALPHA-1));
314 wpot = (1-ALPHA)/(1+THETAP)*kpot_o_npot^ALPHA; % labor demand
315 ypot_o_npot = kpot_o_npot^ALPHA; % production function
316 ivpot_o_npot = DELTA*kpot_o_npot;
317 ivpot_o_ypot = ivpot_o_npot / ypot_o_npot;
318 cpot_o_npot = ypot_o_npot - ivpot_o_npot - g_o_y; % market clearing
319 % The labor level, closed-form solution for labor
320 npot = (cpot_o_npot^(-1)*wpot)^(1/(CHI+1)) ;
321 % Value of remaining variables
322 cpot = cpot_o_npot*npot;
323 ivpot = ivpot_o_npot *npot;
324 kpot = kpot_o_npot*npot;
325 ypot = ypot_o_npot*npot;
326
327 end;
328
329
330
331 % =========================================================================
332 % Declare settings for shocks
333 % =========================================================================
334 shocks;
335 var epsg = 1;
336 var epsnu = 1;
337 end;
338
339 estimated_params;
340 ALPHA, 0.3, normal_pdf, 0.3 , 0.1;
341 BETA, 0.995, normal_pdf, 0.995, 0.1;
342 PIEBAR, 1.005, normal_pdf, 1.005, 0.1;
343 IOTA, 0.5, normal_pdf, 0.5, 0.1;
344 CHI, 1/0.4, normal_pdf, 1/0.4, 0.1;
345 THETAP, 0.1, normal_pdf, 0.1, 0.1;
346 XIP, 2/3, normal_pdf, 2/3, 0.1;
347 PSI, -12.2, normal_pdf, -12.2, 0.1;
348 GAMMAPIE, 1.5, normal_pdf, 1.5, 0.1;
349 GAMMAX, 0.125, normal_pdf, 0.125, 0.1;
350 DELTA, 0, normal_pdf, 0, 0.1;
351 QBAR, 1, normal_pdf, 1, 0.1;
352 NUBAR, 0, normal_pdf, 0, 0.1;
353 BBAR, 0, normal_pdf, 0, 0.1;
354 GBAR_o_YBAR, 0, normal_pdf, 0, 0.1; %commenting this solves the analytic_derivation_mode=-2|-1 problem
355 TAUBAR, 0, normal_pdf, 0, 0.1;
356 TAUNBAR, 0, normal_pdf, 0, 0.1;
357 PHI, 0.0101, normal_pdf, 0.0101, 0.1;
358 RHONU, 0.95, normal_pdf, 0.95, 0.1;
359 RHOG, 0.95, normal_pdf, 0.95, 0.1;
360 SIGNU, 0.6/100, normal_pdf, 0.6/100, 0.1;
361 SIGG, 0.6/100, normal_pdf, 0.6/100, 0.1;
362 end;
363
364
365 % =========================================================================
366 % Computations
367 % =========================================================================
368 model_diagnostics;
369 steady;
370 resid;
371 check;
372
373 identification(order=1,no_identification_strength,analytic_derivation_mode= 0,ar=5); %works
374 %identification(no_identification_strength,analytic_derivation_mode= 1,ar=5); %works, this takes the longest due to Kronecker products
375 options_.dynatol.x = 1e-9;
376 identification(order=1,no_identification_strength,analytic_derivation_mode=-1,ar=5); %works, but tolerance is way too small
377 identification(order=1,no_identification_strength,analytic_derivation_mode=-2,ar=5); %works, but tolerance is way to small
378 options_.dynatol.x = 1e-5; %this is the default value
379 identification(order=1,no_identification_strength,analytic_derivation_mode=-1,ar=5); %works only if GBAR_o_YBAR is uncommented
380 identification(order=1,no_identification_strength,analytic_derivation_mode=-2,ar=5); %works only if GBAR_o_YBAR is uncommented