Update userguide .mod files: change to unix-type line ending and remove extra spaces

time-shift
Houtan Bastani 2010-06-23 15:46:55 +02:00
parent b5baf45f36
commit 441ecaee30
6 changed files with 314 additions and 546 deletions

View File

@ -4,48 +4,48 @@
\paperw11900\paperh16840\margl1440\margr1440\vieww9000\viewh8400\viewkind0 \paperw11900\paperh16840\margl1440\margr1440\vieww9000\viewh8400\viewkind0
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
\f0\fs24 \cf0 // example 1 from Collard's guide to Dynare \ \f0\fs24 \cf0 // example 1 from Collard's guide to Dynare
var y, c, k, a, h, b; \ var y, c, k, a, h, b;
varexo e,u; \ varexo e,u;
\
parameters beta, rho, beta, alpha, delta, theta, psi, tau; \ parameters beta, rho, beta, alpha, delta, theta, psi, tau;
\
alpha = 0.36; \ alpha = 0.36;
rho = 0.95; \ rho = 0.95;
tau = 0.025; \ tau = 0.025;
beta = 0.99; \ beta = 0.99;
delta = 0.025; \ delta = 0.025;
psi = 0; \ psi = 0;
theta = 2.95; \ theta = 2.95;
\
phi = 0.1; \ phi = 0.1;
\
model; \ model;
c*theta*h^(1+psi)=(1-alpha)*y; \ c*theta*h^(1+psi)=(1-alpha)*y;
k = beta*(((exp(b)*c)/(exp(b(+1))*c(+1))) \ k = beta*(((exp(b)*c)/(exp(b(+1))*c(+1)))
*(exp(b(+1))*alpha*y(+1)+(1-delta)*k)); \ *(exp(b(+1))*alpha*y(+1)+(1-delta)*k));
y = exp(a)*(k(-1)^alpha)*(h^(1-alpha)); \ y = exp(a)*(k(-1)^alpha)*(h^(1-alpha));
k = exp(b)*(y-c)+(1-delta)*k(-1); \ k = exp(b)*(y-c)+(1-delta)*k(-1);
a = rho*a(-1)+tau*b(-1) + e; \ a = rho*a(-1)+tau*b(-1) + e;
b = tau*a(-1)+rho*b(-1) + u; \ b = tau*a(-1)+rho*b(-1) + u;
end; \ end;
\
initval; \ initval;
y = 1.08068253095672; \ y = 1.08068253095672;
c = 0.80359242014163; \ c = 0.80359242014163;
h = 0.29175631001732; \ h = 0.29175631001732;
k = 5; \ k = 5;
a = 0; \ a = 0;
b = 0; \ b = 0;
e = 0; \ e = 0;
u = 0; \ u = 0;
end; \ end;
\
shocks; \ shocks;
var e; stderr 0.009; \ var e; stderr 0.009;
var u; stderr 0.009; \ var u; stderr 0.009;
var e, u = phi*0.009*0.009; \ var e, u = phi*0.009*0.009;
end; \ end;
\
stoch_simul(periods=2100); \ stoch_simul(periods=2100);
} }

View File

@ -1,208 +1,69 @@
% Basic RBC Model with Monopolistic Competion. % Basic RBC Model with Monopolistic Competion.
%
% Jesus Fernandez-Villaverde
% % Philadelphia, March 3, 2005
%----------------------------------------------------------------
% 0. Housekeeping
% Jesus Fernandez-Villaverde %----------------------------------------------------------------
close all
% Philadelphia, March 3, 2005
%----------------------------------------------------------------
% 1. Defining variables
%----------------------------------------------------------------
var y c k i l y_l w r z;
%---------------------------------------------------------------- varexo e;
parameters beta psi delta alpha rho gamma sigma epsilon;
% 0. Housekeeping %----------------------------------------------------------------
% 2. Calibration
%----------------------------------------------------------------
%----------------------------------------------------------------
alpha = 0.33;
beta = 0.99;
delta = 0.023;
psi = 1.75;
rho = 0.95;
close all sigma = (0.007/(1-alpha));
epsilon = 10;
%----------------------------------------------------------------
% 3. Model
%----------------------------------------------------------------
%----------------------------------------------------------------
model;
(1/c) = beta*(1/c(+1))*(1+r(+1)-delta);
% 1. Defining variables psi*c/(1-l) = w;
c+i = y;
y = (k(-1)^alpha)*(exp(z)*l)^(1-alpha);
%---------------------------------------------------------------- w = y*((epsilon-1)/epsilon)*(1-alpha)/l;
r = y*((epsilon-1)/epsilon)*alpha/k;
i = k-(1-delta)*k(-1);
y_l = y/l;
z = rho*z(-1)+e;
end;
var y c k i l y_l w r z;
%----------------------------------------------------------------
% 4. Computation
varexo e; %----------------------------------------------------------------
initval;
k = 9;
c = 0.76;
l = 0.3;
parameters beta psi delta alpha rho gamma sigma epsilon; w = 2.07;
r = 0.03;
z = 0;
e = 0;
end;
%---------------------------------------------------------------- shocks;
var e = sigma^2;
end;
% 2. Calibration
steady;
%---------------------------------------------------------------- stoch_simul(periods=1000,irf=0,simul_seed=3);
datatomfile('simuldataRBC',[]);
return;
alpha = 0.33;
beta = 0.99;
delta = 0.023;
psi = 1.75;
rho = 0.95;
sigma = (0.007/(1-alpha));
epsilon = 10;
%----------------------------------------------------------------
% 3. Model
%----------------------------------------------------------------
model;
(1/c) = beta*(1/c(+1))*(1+r(+1)-delta);
psi*c/(1-l) = w;
c+i = y;
y = (k(-1)^alpha)*(exp(z)*l)^(1-alpha);
w = y*((epsilon-1)/epsilon)*(1-alpha)/l;
r = y*((epsilon-1)/epsilon)*alpha/k;
i = k-(1-delta)*k(-1);
y_l = y/l;
z = rho*z(-1)+e;
end;
%----------------------------------------------------------------
% 4. Computation
%----------------------------------------------------------------
initval;
k = 9;
c = 0.76;
l = 0.3;
w = 2.07;
r = 0.03;
z = 0;
e = 0;
end;
shocks;
var e = sigma^2;
end;
steady;
stoch_simul(periods=1000,irf=0,simul_seed=3);
datatomfile('simuldataRBC',[]);
return;

View File

@ -1,40 +1,39 @@
var y c k i l y_l w r z; var y c k i l y_l w r z;
varexo e; varexo e;
parameters beta psi delta alpha rho epsilon; parameters beta psi delta alpha rho epsilon;
model;
(1/c) = beta*(1/c(+1))*(1+r(+1)-delta);
psi*c/(1-l) = w;
c+i = y;
y = (k(-1)^alpha)*(exp(z)*l)^(1-alpha);
w = y*((epsilon-1)/epsilon)*(1-alpha)/l;
r = y*((epsilon-1)/epsilon)*alpha/k(-1);
i = k-(1-delta)*k(-1);
y_l = y/l;
z = rho*z(-1)+e;
end;
varobs y; model;
(1/c) = beta*(1/c(+1))*(1+r(+1)-delta);
initval; psi*c/(1-l) = w;
k = 9; c+i = y;
c = 0.76; y = (k(-1)^alpha)*(exp(z)*l)^(1-alpha);
l = 0.3; w = y*((epsilon-1)/epsilon)*(1-alpha)/l;
w = 2.07; r = y*((epsilon-1)/epsilon)*alpha/k(-1);
r = 0.03; i = k-(1-delta)*k(-1);
z = 0; y_l = y/l;
e = 0; z = rho*z(-1)+e;
end; end;
estimated_params; varobs y;
alpha, beta_pdf, 0.35, 0.02;
beta, beta_pdf, 0.99, 0.002; initval;
delta, beta_pdf, 0.025, 0.003; k = 9;
psi, gamma_pdf, 1.75, 0.02; c = 0.76;
rho, beta_pdf, 0.95, 0.05; l = 0.3;
epsilon, gamma_pdf, 10, 0.003; w = 2.07;
stderr e, inv_gamma_pdf, 0.01, inf; r = 0.03;
end; z = 0;
e = 0;
end;
estimation(datafile=simuldataRBC,nobs=200,first_obs=500,mh_replic=2000,mh_nblocks=2,mh_drop=0.45,mh_jscale=0.8);
estimated_params;
alpha, beta_pdf, 0.35, 0.02;
beta, beta_pdf, 0.99, 0.002;
delta, beta_pdf, 0.025, 0.003;
psi, gamma_pdf, 1.75, 0.02;
rho, beta_pdf, 0.95, 0.05;
epsilon, gamma_pdf, 10, 0.003;
stderr e, inv_gamma_pdf, 0.01, inf;
end;
estimation(datafile=simuldataRBC,nobs=200,first_obs=500,mh_replic=2000,mh_nblocks=2,mh_drop=0.45,mh_jscale=0.8);

View File

@ -1,41 +1,42 @@
var y c k i l y_l w r ; var y c k i l y_l w r ;
varexo z; varexo z;
parameters beta psi delta alpha sigma epsilon; parameters beta psi delta alpha sigma epsilon;
alpha = 0.33;
beta = 0.99; alpha = 0.33;
delta = 0.023; beta = 0.99;
psi = 1.75; delta = 0.023;
sigma = (0.007/(1-alpha)); psi = 1.75;
epsilon = 10; sigma = (0.007/(1-alpha));
epsilon = 10;
model;
(1/c) = beta*(1/c(+1))*(1+r(+1)-delta); model;
psi*c/(1-l) = w; (1/c) = beta*(1/c(+1))*(1+r(+1)-delta);
c+i = y; psi*c/(1-l) = w;
y = (k(-1)^alpha)*(exp(z)*l)^(1-alpha); c+i = y;
w = y*((epsilon-1)/epsilon)*(1-alpha)/l; y = (k(-1)^alpha)*(exp(z)*l)^(1-alpha);
r = y*((epsilon-1)/epsilon)*alpha/k(-1); w = y*((epsilon-1)/epsilon)*(1-alpha)/l;
i = k-(1-delta)*k(-1); r = y*((epsilon-1)/epsilon)*alpha/k(-1);
y_l = y/l; i = k-(1-delta)*k(-1);
end; y_l = y/l;
end;
initval;
k = 9; initval;
c = 0.7; k = 9;
l = 0.3; c = 0.7;
w = 2.0; l = 0.3;
r = 0; w = 2.0;
z = 0; r = 0;
end; z = 0;
end;
steady;
steady;
check;
check;
shocks;
var z; shocks;
periods 1:9; var z;
values 0.1; periods 1:9;
end; values 0.1;
end;
simul(periods=2100); simul(periods=2100);

View File

@ -1,133 +1,45 @@
// Adapted from Jesus Fernandez-Villaverde, Basic RBC Model with Monopolistic Competion Philadelphia, March 3, 2005
// Adapted from Jesus Fernandez-Villaverde, Basic RBC Model with Monopolistic Competion Philadelphia, March 3, 2005 var y c k i l y_l w r z;
varexo e;
parameters beta psi delta alpha rho gamma sigma epsilon;
alpha = 0.33;
beta = 0.99;
delta = 0.023;
var y c k i l y_l w r z; psi = 1.75;
rho = 0.95;
sigma = (0.007/(1-alpha));
varexo e; epsilon = 10;
model;
(1/c) = beta*(1/c(+1))*(1+r(+1)-delta);
psi*c/(1-l) = w;
c+i = y;
parameters beta psi delta alpha rho gamma sigma epsilon; y = (k(-1)^alpha)*(exp(z)*l)^(1-alpha);
w = y*((epsilon-1)/epsilon)*(1-alpha)/l;
r = y*((epsilon-1)/epsilon)*alpha/k(-1);
i = k-(1-delta)*k(-1);
alpha = 0.33; y_l = y/l;
z = rho*z(-1)+e;
end;
beta = 0.99;
initval;
k = 9;
delta = 0.023; c = 0.76;
l = 0.3;
w = 2.07;
psi = 1.75; r = 0.03;
z = 0;
e = 0;
rho = 0.95; end;
steady;
sigma = (0.007/(1-alpha)); check;
shocks;
epsilon = 10; var e = sigma^2;
end;
model;
(1/c) = beta*(1/c(+1))*(1+r(+1)-delta);
psi*c/(1-l) = w;
c+i = y;
y = (k(-1)^alpha)*(exp(z)*l)^(1-alpha);
w = y*((epsilon-1)/epsilon)*(1-alpha)/l;
r = y*((epsilon-1)/epsilon)*alpha/k(-1);
i = k-(1-delta)*k(-1);
y_l = y/l;
z = rho*z(-1)+e;
end;
initval;
k = 9;
c = 0.76;
l = 0.3;
w = 2.07;
r = 0.03;
z = 0;
e = 0;
end;
steady; steady;
check; stoch_simul(periods=2100);
shocks;
var e = sigma^2;
end;
steady;
stoch_simul(periods=2100);

View File

@ -1,86 +1,81 @@
// This file replicates the estimation of the CIA model from // This file replicates the estimation of the CIA model from
// Frank Schorfheide (2000) "Loss function-based evaluation of DSGE models" // Frank Schorfheide (2000) "Loss function-based evaluation of DSGE models"
// Journal of Applied Econometrics, 15, 645-670. // Journal of Applied Econometrics, 15, 645-670.
// the data are the ones provided on Schorfheide's web site with the programs. // the data are the ones provided on Schorfheide's web site with the programs.
// http://www.econ.upenn.edu/~schorf/programs/dsgesel.ZIP // http://www.econ.upenn.edu/~schorf/programs/dsgesel.ZIP
// You need to have fsdat.m in the same directory as this file. // You need to have fsdat.m in the same directory as this file.
// This file replicates: // This file replicates:
// -the posterior mode as computed by Frank's Gauss programs // -the posterior mode as computed by Frank's Gauss programs
// -the parameter mean posterior estimates reported in the paper // -the parameter mean posterior estimates reported in the paper
// -the model probability (harmonic mean) reported in the paper // -the model probability (harmonic mean) reported in the paper
// This file was tested with dyn_mat_test_0218.zip // This file was tested with dyn_mat_test_0218.zip
// the smooth shocks are probably stil buggy // the smooth shocks are probably stil buggy
// //
// The equations are taken from J. Nason and T. Cogley (1994) // The equations are taken from J. Nason and T. Cogley (1994)
// "Testing the implications of long-run neutrality for monetary business // "Testing the implications of long-run neutrality for monetary business
// cycle models" Journal of Applied Econometrics, 9, S37-S70. // cycle models" Journal of Applied Econometrics, 9, S37-S70.
// Note that there is an initial minus sign missing in equation (A1), p. S63. // Note that there is an initial minus sign missing in equation (A1), p. S63.
// //
// Michel Juillard, February 2004 // Michel Juillard, February 2004
var m P c e W R k d n l Y_obs P_obs y dA; var m P c e W R k d n l Y_obs P_obs y dA;
varexo e_a e_m; varexo e_a e_m;
parameters alp bet gam mst rho psi del;
parameters alp bet gam mst rho psi del;
model;
dA = exp(gam+e_a);
log(m) = (1-rho)*log(mst) + rho*log(m(-1))+e_m;
model; -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;
dA = exp(gam+e_a); W = l/n;
log(m) = (1-rho)*log(mst) + rho*log(m(-1))+e_m; -(psi/(1-psi))*(c*P/(1-n))+l/n = 0;
-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; R = P*(1-alp)*exp(-alp*(gam+e_a))*k(-1)^alp*n^(-alp)/W;
W = l/n; 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;
-(psi/(1-psi))*(c*P/(1-n))+l/n = 0; c+k = exp(-alp*(gam+e_a))*k(-1)^alp*n^(1-alp)+(1-del)*exp(-(gam+e_a))*k(-1);
R = P*(1-alp)*exp(-alp*(gam+e_a))*k(-1)^alp*n^(-alp)/W; P*c = m;
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; m-1+d = l;
c+k = exp(-alp*(gam+e_a))*k(-1)^alp*n^(1-alp)+(1-del)*exp(-(gam+e_a))*k(-1); e = exp(e_a);
P*c = m; y = k(-1)^alp*n^(1-alp)*exp(-alp*(gam+e_a));
m-1+d = l; Y_obs/Y_obs(-1) = dA*y/y(-1);
e = exp(e_a); P_obs/P_obs(-1) = (P/P(-1))*m(-1)/dA;
y = k(-1)^alp*n^(1-alp)*exp(-alp*(gam+e_a)); end;
Y_obs/Y_obs(-1) = dA*y/y(-1);
P_obs/P_obs(-1) = (P/P(-1))*m(-1)/dA; varobs P_obs Y_obs;
end;
observation_trends;
varobs P_obs Y_obs; P_obs (log(mst)-gam);
Y_obs (gam);
observation_trends; end;
P_obs (log(mst)-gam);
Y_obs (gam); unit_root_vars P_obs Y_obs;
end;
initval;
unit_root_vars P_obs Y_obs; k = 6;
m = mst;
initval; P = 2.25;
k = 6; c = 0.45;
m = mst; e = 1;
P = 2.25; W = 4;
c = 0.45; R = 1.02;
e = 1; d = 0.85;
W = 4; n = 0.19;
R = 1.02; l = 0.86;
d = 0.85; y = 0.6;
n = 0.19; dA = exp(gam);
l = 0.86; end;
y = 0.6;
dA = exp(gam); steady;
end;
estimated_params;
steady; alp, beta_pdf, 0.356, 0.02;
bet, beta_pdf, 0.993, 0.002;
gam, normal_pdf, 0.0085, 0.003;
estimated_params; mst, normal_pdf, 1.0002, 0.007;
alp, beta_pdf, 0.356, 0.02; rho, beta_pdf, 0.129, 0.223;
bet, beta_pdf, 0.993, 0.002; psi, beta_pdf, 0.65, 0.05;
gam, normal_pdf, 0.0085, 0.003; del, beta_pdf, 0.01, 0.005;
mst, normal_pdf, 1.0002, 0.007; stderr e_a, inv_gamma_pdf, 0.035449, inf;
rho, beta_pdf, 0.129, 0.223; stderr e_m, inv_gamma_pdf, 0.008862, inf;
psi, beta_pdf, 0.65, 0.05; end;
del, beta_pdf, 0.01, 0.005;
stderr e_a, inv_gamma_pdf, 0.035449, inf; estimation(datafile=fsdat,nobs=192,loglinear,mh_replic=2000,
stderr e_m, inv_gamma_pdf, 0.008862, inf;
end;
estimation(datafile=fsdat,nobs=192,loglinear,mh_replic=2000,
mode_compute=4,mh_nblocks=2,mh_drop=0.45,mh_jscale=0.65); mode_compute=4,mh_nblocks=2,mh_drop=0.45,mh_jscale=0.65);