Debian Codegraph @

tests/estimation/fs2000_mixed_ML_xfail.mod

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 theta;
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 theta=0;
51
52 model;
53 dA = exp(gam+e_a);
54 log(m) = (1-rho)*log(mst) + rho*log(m(-1))+e_m;
55 -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;
56 W = l/n;
57 -(psi/(1-psi))*(c*P/(1-n))+l/n = 0;
58 R = P*(1-alp)*exp(-alp*(gam+e_a))*k(-1)^alp*n^(-alp)/W;
59 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;
60 c+k = exp(-alp*(gam+e_a))*k(-1)^alp*n^(1-alp)+(1-del)*exp(-(gam+e_a))*k(-1);
61 P*c = m;
62 m-1+d = l;
63 e = exp(e_a);
64 y = k(-1)^alp*n^(1-alp)*exp(-alp*(gam+e_a));
65 gy_obs = dA*y/y(-1);
66 gp_obs = (P/P(-1))*m(-1)/dA;
67 end;
68
69 steady_state_model;
70 dA = exp(gam);
71 gst = 1/dA;
72 m = mst;
73 khst = ( (1-gst*bet*(1-del)) / (alp*gst^alp*bet) )^(1/(alp-1));
74 xist = ( ((khst*gst)^alp - (1-gst*(1-del))*khst)/mst )^(-1);
75 nust = psi*mst^2/( (1-alp)*(1-psi)*bet*gst^alp*khst^alp );
76 n = xist/(nust+xist);
77 P = xist + nust;
78 k = khst*n;
79
80 l = psi*mst*n/( (1-psi)*(1-n) );
81 c = mst/P;
82 d = l - mst + 1;
83 y = k^alp*n^(1-alp)*gst^alp;
84 R = mst/bet;
85 W = l/n;
86 ist = y-c;
87 q = 1 - d;
88
89 e = 1;
90
91 gp_obs = m/dA;
92 gy_obs = dA;
93 end;
94
95 shocks;
96 var e_a; stderr 0.014;
97 var e_m; stderr 0.005;
98 corr e_m, e_a = 0.1;
99 var gp_obs; stderr 0.01;
100 end;
101
102 varobs gp_obs gy_obs;
103
104 steady;
105 check;
106
107 estimated_params;
108 alp, 0.33;
109 bet, beta_pdf, 0.993, 0.002;
110 end;
111
112 estimated_params_init(use_calibration);
113 end;
114
115 estimation(mode_compute=4,order=1,datafile=fsdat_simul,mode_check,smoother,filter_decomposition,forecast = 8,filtered_vars,filter_step_ahead=[1,3],irf=20) m P c e W R k d y gy_obs;