Debian Codegraph @

tests/kalman/lik_init/fs2000_common.inc

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