| 1 |
% This is the Clarida, Gali and Gertler Basic New Keynesian model |
| 2 |
% This mod file illustrates that due to numerical errors and numerical |
| 3 |
% settings the identification criteria might differ |
| 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 |
var |
| 25 |
y ${y}$ (long_name='output') |
| 26 |
c ${c}$ (long_name='consumption') |
| 27 |
lam ${\lambda}$ (long_name='marginal utility, i.e. lagrange multiplier budget') |
| 28 |
R ${R}$ (long_name='nominal interest rate') |
| 29 |
pie ${\pi}$ (long_name='inflation rate') |
| 30 |
n ${n}$ (long_name='labor') |
| 31 |
w ${w}$ (long_name='real wage') |
| 32 |
mc ${mc}$ (long_name='marginal costs') |
| 33 |
pstar ${p^\ast}$ (long_name='price dispersion') |
| 34 |
ptilde ${\tilde{p}}$ (long_name='reoptimized price') |
| 35 |
S1 ${S_{1}}$ (long_name='auxiliary variable for nonlinear pricing 1') |
| 36 |
S2 ${S_{2}}$ (long_name='auxiliary variable for nonlinear pricing 2') |
| 37 |
a ${a}$ (long_name='total factor productivity') |
| 38 |
RR ${R^{**}}$ (long_name='natural interest rate') |
| 39 |
yy ${y^{**}}$ (long_name='natural output') |
| 40 |
x ${x}$ (long_name='output gap') |
| 41 |
da ${\delta a}$ (long_name='technology growth') |
| 42 |
; |
| 43 |
|
| 44 |
varexo |
| 45 |
epsa ${\varepsilon^A}$ (long_name='TFP shock') |
| 46 |
epsR ${\varepsilon^R}$ (long_name='monetary policy shock') |
| 47 |
; |
| 48 |
|
| 49 |
parameters |
| 50 |
BETA ${\beta}$ (long_name='discount factor') |
| 51 |
PIESTAR ${\pi^\ast}$ (long_name='annual target inflation rate') |
| 52 |
PSIPIE ${\psi_\pi}$ (long_name='Taylor rule parameter inflation') |
| 53 |
PSIY ${\psi_y}$ (long_name='Taylor rule parameter output') |
| 54 |
RHOR ${\rho_R}$ (long_name='persistence Taylor rule') |
| 55 |
SIGR ${\sigma_R}$ (long_name='standard deviation monetary policy shock') |
| 56 |
ETA ${\eta}$ (long_name='elasticity of substitution') |
| 57 |
THETA ${\theta}$ (long_name='Calvo probability of resetting prices') |
| 58 |
PSI ${\psi}$ (long_name='labor disutility parameter') |
| 59 |
RHOA ${\rho_A}$ (long_name='persistence TFP') |
| 60 |
SIGA ${\sigma_A}$ (long_name='standard deviation TFP shock') |
| 61 |
SUBSIDY ${\nu}$ (long_name='subsidy') |
| 62 |
; |
| 63 |
|
| 64 |
%Calibration |
| 65 |
BETA = 0.99; |
| 66 |
PIESTAR = 1; |
| 67 |
PSIPIE = 1.5; |
| 68 |
PSIY = 0; |
| 69 |
RHOR = 0; |
| 70 |
SIGR = 0.2; |
| 71 |
ETA = 2; |
| 72 |
THETA = 3/4; |
| 73 |
PSI = 1; |
| 74 |
RHOA = 0.5; |
| 75 |
SIGA = 0.01; |
| 76 |
SUBSIDY = 1 - (ETA-1)/ETA; |
| 77 |
|
| 78 |
model; |
| 79 |
|
| 80 |
[name='marginal utility of consumption'] |
| 81 |
lam = 1/c; |
| 82 |
|
| 83 |
[name='Euler equation'] |
| 84 |
lam = BETA*R/pie(+1)*lam(+1); |
| 85 |
|
| 86 |
[name='labor supply'] |
| 87 |
lam*w = n^PSI; |
| 88 |
|
| 89 |
[name='aggregate supply'] |
| 90 |
pstar*y = a*n; |
| 91 |
|
| 92 |
[name='labor demand'] |
| 93 |
w*(1-SUBSIDY) = mc*a; |
| 94 |
|
| 95 |
[name='market clearing'] |
| 96 |
y = c; |
| 97 |
|
| 98 |
[name='recursive Price'] |
| 99 |
ptilde*S1 = ETA/(ETA-1)*S2; |
| 100 |
|
| 101 |
[name='recursive Price 1'] |
| 102 |
S1 = y + THETA*BETA*lam(+1)/lam*pie(+1)^(ETA-1)*S1(+1); |
| 103 |
|
| 104 |
[name='recursive Price 2'] |
| 105 |
S2 = y*mc + THETA*BETA*lam(+1)/lam*pie(+1)^(ETA)*S2(+1); |
| 106 |
|
| 107 |
[name='aggregate price index'] |
| 108 |
1 = (1-THETA)*ptilde^(1-ETA) + THETA*pie^(ETA-1); |
| 109 |
|
| 110 |
[name='overall price dispersion'] |
| 111 |
pstar = (1-THETA)*ptilde^(-ETA) + THETA*pie^(ETA)*pstar(-1); |
| 112 |
|
| 113 |
[name='Taylor rule'] |
| 114 |
R = steady_state(R)^(1-RHOR)*R(-1)^RHOR*(pie/PIESTAR)^PSIPIE*(y/steady_state(y))^PSIY*exp(epsR); |
| 115 |
|
| 116 |
[name='evolution of technology'] |
| 117 |
log(a) = RHOA*log(a(-1)) + epsa; |
| 118 |
|
| 119 |
[name='technology growth'] |
| 120 |
da = log(a/a(-1)); |
| 121 |
|
| 122 |
[name='efficient interest rate'] |
| 123 |
RR = 1/BETA * a(+1)/a; |
| 124 |
|
| 125 |
[name='efficient output'] |
| 126 |
yy = a; |
| 127 |
|
| 128 |
[name='output gap'] |
| 129 |
x = (y-yy); |
| 130 |
|
| 131 |
end; |
| 132 |
|
| 133 |
steady_state_model; |
| 134 |
a = 1; |
| 135 |
da = 0; |
| 136 |
pie = PIESTAR; |
| 137 |
R = pie/BETA; |
| 138 |
ptilde = ( (1-THETA*pie^(ETA-1))/ (1-THETA) )^(1/(1-ETA)); |
| 139 |
pstar = ( (1-THETA) / (1-THETA*pie^(ETA)) )*ptilde^(-ETA); |
| 140 |
mc = (ETA-1)/ETA*ptilde* (1-THETA*BETA*pie^(ETA)) / (1-THETA*BETA*pie^(ETA-1)); |
| 141 |
w = 1/(1-SUBSIDY)*mc*a; |
| 142 |
n = (pstar*mc/(1-SUBSIDY))^(1/(PSI+1)); |
| 143 |
y = pstar^(-1)*a*n; |
| 144 |
c = y; |
| 145 |
lam = 1/c; |
| 146 |
S1 = y/(1-THETA*BETA*pie^(ETA-1)); |
| 147 |
S2 = y*mc/(1-THETA*BETA*pie^(ETA)); |
| 148 |
RR = 1/BETA; |
| 149 |
yy = a; |
| 150 |
x = y-yy; |
| 151 |
end; |
| 152 |
|
| 153 |
|
| 154 |
shocks; |
| 155 |
var epsa = SIGA^2; |
| 156 |
var epsR = SIGR^2; |
| 157 |
end; |
| 158 |
|
| 159 |
|
| 160 |
model_diagnostics; |
| 161 |
steady; |
| 162 |
resid; |
| 163 |
check; |
| 164 |
|
| 165 |
estimated_params; |
| 166 |
PIESTAR , 1; |
| 167 |
PSIPIE , 1.5; |
| 168 |
PSIY , 0; |
| 169 |
RHOR , 0; |
| 170 |
ETA , 1.5; |
| 171 |
end; |
| 172 |
|
| 173 |
varobs y c; |
| 174 |
identification(tol_rank=1e-13, tol_sv=1e-2, tol_deriv=1e-6, normalize_jacobians=0, checks_via_subsets=0); |
| 175 |
identification(tol_rank=1e-13, tol_sv=1e-2, tol_deriv=1e-6, normalize_jacobians=1, checks_via_subsets=0); |
| 176 |
identification(tol_rank=1e-13, tol_sv=1e-2, tol_deriv=1e-6, normalize_jacobians=0, checks_via_subsets=1); |
| 177 |
identification(tol_rank=1e-13, tol_sv=1e-2, tol_deriv=1e-6, normalize_jacobians=1, checks_via_subsets=1); |
| 178 |
|
| 179 |
estim_params_ = []; |
| 180 |
identification(checks_via_subsets=1, max_dim_subsets_groups=4); |