Debian Codegraph @

tests/estimation/MH_recover/fs2000.common.inc

raw
1 /*
2 * This file replicates the estimation of the cash in advance model described
3 * Frank Schorfheide (2000): "Loss function-based evaluation of DSGE models",
4 * Journal of Applied Econometrics, 15(6), 645-670.
5 *
6 * The data are in file "fsdat_simul.m", and have been artificially generated.
7 * They are therefore different from the original dataset used by Schorfheide.
8 *
9 * The equations are taken from J. Nason and T. Cogley (1994): "Testing the
10 * implications of long-run neutrality for monetary business cycle models",
11 * Journal of Applied Econometrics, 9, S37-S70.
12 * Note that there is an initial minus sign missing in equation (A1), p. S63.
13 *
14 * This implementation was written by Michel Juillard. Please note that the
15 * following copyright notice only applies to this Dynare implementation of the
16 * model.
17 */
18
19 /*
20 * Copyright © 2004-2010 Dynare Team
21 *
22 * This file is part of Dynare.
23 *
24 * Dynare is free software: you can redistribute it and/or modify
25 * it under the terms of the GNU General Public License as published by
26 * the Free Software Foundation, either version 3 of the License, or
27 * (at your option) any later version.
28 *
29 * Dynare is distributed in the hope that it will be useful,
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 * GNU General Public License for more details.
33 *
34 * You should have received a copy of the GNU General Public License
35 * along with Dynare. If not, see <https://www.gnu.org/licenses/>.
36 */
37
38 var m P c e W R k d n l gy_obs gp_obs y dA;
39 varexo e_a e_m;
40
41 parameters alp bet gam mst rho psi del;
42
43 alp = 0.33;
44 bet = 0.99;
45 gam = 0.003;
46 mst = 1.011;
47 rho = 0.7;
48 psi = 0.787;
49 del = 0.02;
50
51 model;
52 dA = exp(gam+e_a);
53 log(m) = (1-rho)*log(mst) + rho*log(m(-1))+e_m;
54 -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;
55 W = l/n;
56 -(psi/(1-psi))*(c*P/(1-n))+l/n = 0;
57 R = P*(1-alp)*exp(-alp*(gam+e_a))*k(-1)^alp*n^(-alp)/W;
58 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;
59 c+k = exp(-alp*(gam+e_a))*k(-1)^alp*n^(1-alp)+(1-del)*exp(-(gam+e_a))*k(-1);
60 P*c = m;
61 m-1+d = l;
62 e = exp(e_a);
63 y = k(-1)^alp*n^(1-alp)*exp(-alp*(gam+e_a));
64 gy_obs = dA*y/y(-1);
65 gp_obs = (P/P(-1))*m(-1)/dA;
66 end;
67
68 shocks;
69 var e_a; stderr 0.014;
70 var e_m; stderr 0.005;
71 end;
72
73 steady_state_model;
74 dA = exp(gam);
75 gst = 1/dA;
76 m = mst;
77 khst = ( (1-gst*bet*(1-del)) / (alp*gst^alp*bet) )^(1/(alp-1));
78 xist = ( ((khst*gst)^alp - (1-gst*(1-del))*khst)/mst )^(-1);
79 nust = psi*mst^2/( (1-alp)*(1-psi)*bet*gst^alp*khst^alp );
80 n = xist/(nust+xist);
81 P = xist + nust;
82 k = khst*n;
83
84 l = psi*mst*n/( (1-psi)*(1-n) );
85 c = mst/P;
86 d = l - mst + 1;
87 y = k^alp*n^(1-alp)*gst^alp;
88 R = mst/bet;
89 W = l/n;
90 ist = y-c;
91 q = 1 - d;
92
93 e = 1;
94
95 gp_obs = m/dA;
96 gy_obs = dA;
97 end;
98
99 steady;
100
101 check;
102
103 estimated_params;
104 alp, beta_pdf, 0.356, 0.02;
105 bet, beta_pdf, 0.993, 0.002;
106 gam, normal_pdf, 0.0085, 0.003;
107 mst, normal_pdf, 1.0002, 0.007;
108 rho, beta_pdf, 0.129, 0.05;
109 psi, beta_pdf, 0.65, 0.05;
110 del, beta_pdf, 0.01, 0.005;
111 stderr e_a, inv_gamma_pdf, 0.035449, inf;
112 stderr e_m, inv_gamma_pdf, 0.008862, inf;
113 end;
114
115 varobs gp_obs gy_obs;
116 options_.plot_priors=0;