| 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. This version estimates the model in level rather than in growth rates. |
| 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_obs P_obs y dA; |
| 36 |
varexo e_a e_m; |
| 37 |
|
| 38 |
parameters alp bet gam mst rho psi del; |
| 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 |
|
| 48 |
model; |
| 49 |
dA = exp(gam+e_a); |
| 50 |
log(m) = (1-rho)*log(mst) + rho*log(m(-1))+e_m; |
| 51 |
-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; |
| 52 |
W = l/n; |
| 53 |
-(psi/(1-psi))*(c*P/(1-n))+l/n = 0; |
| 54 |
R = P*(1-alp)*exp(-alp*(gam+e_a))*k(-1)^alp*n^(-alp)/W; |
| 55 |
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; |
| 56 |
c+k = exp(-alp*(gam+e_a))*k(-1)^alp*n^(1-alp)+(1-del)*exp(-(gam+e_a))*k(-1); |
| 57 |
P*c = m; |
| 58 |
m-1+d = l; |
| 59 |
e = exp(e_a); |
| 60 |
y = k(-1)^alp*n^(1-alp)*exp(-alp*(gam+e_a)); |
| 61 |
gy_obs = dA*y/y(-1); |
| 62 |
gp_obs = (P/P(-1))*m(-1)/dA; |
| 63 |
Y_obs/Y_obs(-1) = gy_obs; |
| 64 |
P_obs/P_obs(-1) = gp_obs; |
| 65 |
end; |
| 66 |
|
| 67 |
steady_state_model; |
| 68 |
dA = exp(gam); |
| 69 |
gst = 1/dA; |
| 70 |
m = mst; |
| 71 |
khst = ( (1-gst*bet*(1-del)) / (alp*gst^alp*bet) )^(1/(alp-1)); |
| 72 |
xist = ( ((khst*gst)^alp - (1-gst*(1-del))*khst)/mst )^(-1); |
| 73 |
nust = psi*mst^2/( (1-alp)*(1-psi)*bet*gst^alp*khst^alp ); |
| 74 |
n = xist/(nust+xist); |
| 75 |
P = xist + nust; |
| 76 |
k = khst*n; |
| 77 |
|
| 78 |
l = psi*mst*n/( (1-psi)*(1-n) ); |
| 79 |
c = mst/P; |
| 80 |
d = l - mst + 1; |
| 81 |
y = k^alp*n^(1-alp)*gst^alp; |
| 82 |
R = mst/bet; |
| 83 |
W = l/n; |
| 84 |
ist = y-c; |
| 85 |
q = 1 - d; |
| 86 |
|
| 87 |
e = 1; |
| 88 |
|
| 89 |
gy_obs = exp(gam); |
| 90 |
gp_obs = exp(-gam); |
| 91 |
Y_obs=gy_obs; |
| 92 |
P_obs=gp_obs; |
| 93 |
end; |
| 94 |
|
| 95 |
shocks; |
| 96 |
var e_a; stderr 0.014; |
| 97 |
var e_m; stderr 0.005; |
| 98 |
end; |
| 99 |
|
| 100 |
check(nocheck); |
| 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 P_obs, 1; |
| 110 |
stderr Y_obs, 1; |
| 111 |
corr P_obs, Y_obs,0; |
| 112 |
end; |
| 113 |
|
| 114 |
varobs P_obs Y_obs; |
| 115 |
|
| 116 |
observation_trends; |
| 117 |
P_obs (log(mst)-gam); |
| 118 |
Y_obs (gam); |
| 119 |
end; |
| 120 |
|
| 121 |
data(file='../../fs2000/fsdat_simul.m'); |
| 122 |
options_.diffuse_filter=1; |
| 123 |
options_.order=1; |
| 124 |
|
| 125 |
[dataset_, dataset_info, xparam1, hh, M_, options_, oo_, estim_params_, bayestopt_, bounds] = ... |
| 126 |
dynare_estimation_init(char(), M_.fname, [], M_, options_, oo_, estim_params_, bayestopt_); |