Debian Codegraph @

tests/estimation/fs2000_estimated_params_init.mod

raw
1 // Test that the presence of a non estimated parameter in the estimated_params_init block does not lead to a crash.
2
3 /*
4 * Copyright © 2004-2017 Dynare Team
5 *
6 * This file is part of Dynare.
7 *
8 * Dynare is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * Dynare is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with Dynare. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22 var m P c e W R k d n l gy_obs gp_obs y dA;
23 varexo e_a e_m;
24
25 parameters alp bet gam mst rho psi del;
26
27 alp = 0.33;
28 bet = 0.99;
29 gam = 0.003;
30 mst = 1.011;
31 rho = 0.7;
32 psi = 0.787;
33 del = 0.02;
34
35 model;
36 dA = exp(gam+e_a);
37 log(m) = (1-rho)*log(mst) + rho*log(m(-1))+e_m;
38 -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;
39 W = l/n;
40 -(psi/(1-psi))*(c*P/(1-n))+l/n = 0;
41 R = P*(1-alp)*exp(-alp*(gam+e_a))*k(-1)^alp*n^(-alp)/W;
42 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;
43 c+k = exp(-alp*(gam+e_a))*k(-1)^alp*n^(1-alp)+(1-del)*exp(-(gam+e_a))*k(-1);
44 P*c = m;
45 m-1+d = l;
46 e = exp(e_a);
47 y = k(-1)^alp*n^(1-alp)*exp(-alp*(gam+e_a));
48 gy_obs = dA*y/y(-1);
49 gp_obs = (P/P(-1))*m(-1)/dA;
50 end;
51
52 shocks;
53 var e_a; stderr 0.014;
54 var e_m; stderr 0.005;
55 end;
56
57 steady_state_model;
58 dA = exp(gam);
59 gst = 1/dA;
60 m = mst;
61 khst = ( (1-gst*bet*(1-del)) / (alp*gst^alp*bet) )^(1/(alp-1));
62 xist = ( ((khst*gst)^alp - (1-gst*(1-del))*khst)/mst )^(-1);
63 nust = psi*mst^2/( (1-alp)*(1-psi)*bet*gst^alp*khst^alp );
64 n = xist/(nust+xist);
65 P = xist + nust;
66 k = khst*n;
67
68 l = psi*mst*n/( (1-psi)*(1-n) );
69 c = mst/P;
70 d = l - mst + 1;
71 y = k^alp*n^(1-alp)*gst^alp;
72 R = mst/bet;
73 W = l/n;
74 ist = y-c;
75 q = 1 - d;
76
77 e = 1;
78
79 gp_obs = m/dA;
80 gy_obs = dA;
81 end;
82
83 steady;
84
85 check;
86
87 estimated_params;
88 alp, beta_pdf, 0.356, 0.02;
89 bet, beta_pdf, 0.993, 0.002;
90 gam, normal_pdf, 0.0085, 0.003;
91 mst, normal_pdf, 1.0002, 0.007;
92 rho, beta_pdf, 0.129, 0.100;
93 psi, beta_pdf, 0.65, 0.05;
94 % del, beta_pdf, 0.01, 0.005;
95 % stderr e_a, inv_gamma_pdf, 0.035449, inf;
96 stderr e_m, inv_gamma_pdf, 0.008862, inf;
97 end;
98
99 estimated_params_init;
100 del,0.02;
101 stderr e_a, 0.01;
102 corr e_a,e_m, 0.5;
103 end;
104
105 varobs gp_obs gy_obs;