Debian Codegraph @

tests/estimation/pct/fs2000.mod

raw
1 /*
2 * Copyright © 2004-2023 Dynare Team
3 *
4 * This file is part of Dynare.
5 *
6 * Dynare is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * Dynare is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with Dynare. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20 var m ${m}$ (long_name='money growth')
21 P ${P}$ (long_name='Price level')
22 c ${c}$ (long_name='consumption')
23 e ${e}$ (long_name='capital stock')
24 W ${W}$ (long_name='Wage rate')
25 R ${R}$ (long_name='interest rate')
26 k ${k}$ (long_name='capital stock')
27 d ${d}$ (long_name='dividends')
28 n ${n}$ (long_name='labor')
29 l ${l}$ (long_name='loans')
30 gy_obs ${\Delta \ln GDP}$ (long_name='detrended capital stock')
31 gp_obs ${\Delta \ln P}$ (long_name='detrended capital stock')
32 y ${y}$ (long_name='detrended output')
33 dA ${\Delta A}$ (long_name='TFP growth')
34 ;
35 varexo e_a ${\epsilon_A}$ (long_name='TFP shock')
36 e_m ${\epsilon_M}$ (long_name='Money growth shock')
37 ;
38
39 parameters alp ${\alpha}$ (long_name='capital share')
40 bet ${\beta}$ (long_name='discount factor')
41 gam ${\gamma}$ (long_name='long-run TFP growth')
42 logmst ${\log(m^*)}$ (long_name='long-run money growth')
43 rho ${\rho}$ (long_name='autocorrelation money growth')
44 phi ${\phi}$ (long_name='labor weight in consumption')
45 del ${\delta}$ (long_name='depreciation rate')
46 ;
47
48 % roughly picked values to allow simulating the model before estimation
49 alp = 0.33;
50 bet = 0.99;
51 gam = 0.003;
52 logmst = log(1.011);
53 rho = 0.7;
54 phi = 0.787;
55 del = 0.02;
56
57 model;
58 [name='NC before eq. (1), TFP growth equation']
59 dA = exp(gam+e_a);
60 [name='NC eq. (2), money growth rate']
61 log(m) = (1-rho)*logmst + rho*log(m(-1))+e_m;
62 [name='NC eq. (A1), Euler equation']
63 -P/(c(+1)*P(+1)*m)+bet*P(+1)*(alp*exp(-alp*(gam+log(e(+1))))*k^(alp-1)*n(+1)^(1-alp)+(1-del)*exp(-(gam+log(e(+1)))))/(c(+2)*P(+2)*m(+1))=0;
64 [name='NC below eq. (A1), firm borrowing constraint']
65 W = l/n;
66 [name='NC eq. (A2), intratemporal labour market condition']
67 -(phi/(1-phi))*(c*P/(1-n))+l/n = 0;
68 [name='NC below eq. (A2), credit market clearing']
69 R = P*(1-alp)*exp(-alp*(gam+e_a))*k(-1)^alp*n^(-alp)/W;
70 [name='NC eq. (A3), credit market optimality']
71 1/(c*P)-bet*P*(1-alp)*exp(-alp*(gam+e_a))*k(-1)^alp*n^(1-alp)/(m*l*c(+1)*P(+1)) = 0;
72 [name='NC eq. (18), aggregate resource constraint']
73 c+k = exp(-alp*(gam+e_a))*k(-1)^alp*n^(1-alp)+(1-del)*exp(-(gam+e_a))*k(-1);
74 [name='NC eq. (19), money market condition']
75 P*c = m;
76 [name='NC eq. (20), credit market equilibrium condition']
77 m-1+d = l;
78 [name='Definition TFP shock']
79 e = exp(e_a);
80 [name='Implied by NC eq. (18), production function']
81 y = k(-1)^alp*n^(1-alp)*exp(-alp*(gam+e_a));
82 [name='Observation equation GDP growth']
83 gy_obs = dA*y/y(-1);
84 [name='Observation equation price level']
85 gp_obs = (P/P(-1))*m(-1)/dA;
86 end;
87
88 shocks;
89 var e_a; stderr 0.014;
90 var e_m; stderr 0.005;
91 end;
92
93 steady_state_model;
94 dA = exp(gam);
95 gst = 1/dA;
96 m = exp(logmst);
97 khst = ( (1-gst*bet*(1-del)) / (alp*gst^alp*bet) )^(1/(alp-1));
98 xist = ( ((khst*gst)^alp - (1-gst*(1-del))*khst)/m )^(-1);
99 nust = phi*m^2/( (1-alp)*(1-phi)*bet*gst^alp*khst^alp );
100 n = xist/(nust+xist);
101 P = xist + nust;
102 k = khst*n;
103
104 l = phi*m*n/( (1-phi)*(1-n) );
105 c = m/P;
106 d = l - m + 1;
107 y = k^alp*n^(1-alp)*gst^alp;
108 R = m/bet;
109 W = l/n;
110 ist = y-c;
111 q = 1 - d;
112
113 e = 1;
114
115 gp_obs = m/dA;
116 gy_obs = dA;
117 end;
118
119
120 steady;
121 check;
122
123 % Table 1 of Schorfheide (2000)
124 estimated_params;
125 alp, beta_pdf, 0.356, 0.02;
126 bet, beta_pdf, 0.993, 0.002;
127 gam, normal_pdf, 0.0085, 0.003;
128 logmst, normal_pdf, 0.0002, 0.007;
129 rho, beta_pdf, 0.129, 0.223;
130 phi, beta_pdf, 0.65, 0.05;
131 del, beta_pdf, 0.01, 0.005;
132 stderr e_a, inv_gamma_pdf, 0.035449, inf;
133 stderr e_m, inv_gamma_pdf, 0.008862, inf;
134 end;
135
136 varobs gp_obs gy_obs;
137
138 estimation(order=1, datafile=fs2000_data, loglinear,logdata, mode_compute=4, mh_replic=20000,
139 nodiagnostic, mh_nblocks=4, mh_jscale=0.8, posterior_sampler_options = ('save_tmp_file', 1),nograph);