Commit c9c6fc36 authored by Marco Ratto's avatar Marco Ratto
Browse files

Test files for identification

parent 1b2fbc89
var pie y R g z YGR INFL INT;
varexo e_R e_g e_z;
parameters tau kap psi1 psi2 rhoR rhog rhoz rr_steady pi_steady gam_steady std_R std_g std_z;
tau = 2;
kap = 0.15;
psi1 = 1.5;
psi2 = 1;
rhoR = 0.96;
rhog = 0.95;
rhoz = 0.65;
rr_steady = 0.4;
pi_steady = 4.0;
gam_steady = 0.5;
std_R = 0.2;
std_g = 0.8;
std_z = 0.45;
model;
y = y(+1) + g - g(+1) - 1/tau*(R-pie(+1)-z(+1));
pie = 1/(1+rr_steady/400)*pie(+1)+kap*(y-g);
R = rhoR*R(-1)+(1-rhoR)*psi1*pie+(1-rhoR)*psi2*(y-y(-1)+z)+e_R*std_R;
g = rhog*g(-1)+e_g*std_g;
z = rhoz*z(-1)+e_z*std_z;
YGR = gam_steady+100*(y-y(-1)+z);
INFL = pi_steady+400*pie;
INT = pi_steady+rr_steady+4*gam_steady+400*R;
end;
estimated_params;
tau, gamma_pdf, 2, 0.5;
kap, beta_pdf, 0.2, 0.1;
psi1, gamma_pdf, 1.5, 0.25;
psi2, gamma_pdf, 0.5, 0.25;
rhoR, beta_pdf, 0.5, 0.2;
rhog, beta_pdf, 0.8, 0.1;
rhoz, beta_pdf, 0.66, 0.15;
rr_steady, gamma_pdf, 0.8, 0.5;
pi_steady, gamma_pdf, 0.8, 0.5;
gam_steady, gamma_pdf, 0.8, 0.5;
std_R, inv_gamma_pdf, 0.05, inf;
std_g, inv_gamma_pdf, 0.05, inf;
std_z, inv_gamma_pdf, 0.05, inf;
end;
steady;
check;
varobs YGR INFL INT;
shocks;
var e_g;
stderr 1;
var e_R;
stderr 1;
var e_z;
stderr 1;
end;
identification;
function [ys,check1]=as2007_steadystate(junk, ys)
global M_ options_
for j=1:size(M_.param_names,1)
eval([deblank(M_.param_names(j,:)),' = M_.params(j);'])
assignin('base',deblank(M_.param_names(j,:)),M_.params(j));
end
for j=1:size(M_.endo_names,1)
eval([deblank(M_.endo_names(j,:)),' = NaN;'])
end
check1=0;
pie=0;
y=0;
R=0;
g=0;
z=0;
YGR=gam_steady;
INFL = pi_steady;
INT = pi_steady+rr_steady+4*gam_steady;
ys=[
pie
y
R
g
z
YGR
INFL
INT];
\ No newline at end of file
var c k i a lam;
varexo ea;
parameters
alph
betae
delta
as
s
theta
phi
;
alph=0.6;
betae=0.99;
delta=0.0125;
as=0.1;
phi=2;
s=betae*delta*alph/(1-betae+delta*betae);
theta=1;
model;
//(1-(betae*delta*alph/(1-betae+delta*betae)))^theta/c^(1+theta)/(1+theta)*(1+theta)*(i/(betae*delta*alph/(1-betae+delta*betae)))^theta*(i/k/delta)^phi=betae*(1-(betae*delta*alph/(1-betae+delta*betae)))^theta/c(+1)^(1+theta)/(1+theta)*(alph*(1+theta)*a(+1)^(1+theta)*k^(alph*(1+theta)-1)+(1-delta)*(i(+1)/k/delta)^phi*(1+theta)*(i(+1)/(betae*delta*alph/(1-betae+delta*betae)))^theta);
lam*(1+theta)*(i/(betae*delta*alph/(1-betae+delta*betae)))^theta*(i/k/delta)^phi=betae*lam(+1)*(alph*(1+theta)*a(+1)^(1+theta)*k^(alph*(1+theta)-1)+(1-delta)*(i(+1)/k/delta)^phi*(1+theta)*(i(+1)/(betae*delta*alph/(1-betae+delta*betae)))^theta);
k=(delta*(i/delta)^(1-phi)+(1-delta)*k(-1)^(1-phi))^(1/(1-phi));
((1-(betae*delta*alph/(1-betae+delta*betae)))*(c/(1-(betae*delta*alph/(1-betae+delta*betae))))^(1+theta) +
(betae*delta*alph/(1-betae+delta*betae))*(i/(betae*delta*alph/(1-betae+delta*betae)))^(1+theta))^(1/(1+theta))=
(a*k(-1)^alph);
a = as+ea;
lam = (1-(betae*delta*alph/(1-betae+delta*betae)))^theta/c^(1+theta)/(1+theta);
end;
steady;
check;
shocks;
var ea = 1;
end;
estimated_params;
alph ,uniform_pdf,0.6,0.04,0.5,0.7;
//betae ,uniform_pdf,0.99,0.004,0.98,1;
//delta ,uniform_pdf,0.0125,0.001,0.01,0.015;
phi ,uniform_pdf,0.5,0.2,0,10;
theta ,uniform_pdf,0.3,0.1,0,10;
end;
varobs c i;
//varobs c i lam; //to check if observing lam identifies phi and theta
identification(ar=1);
//identification(prior_mc=100);
function [ys,check1]=kim_steadystate(junk, ys)
global M_ options_
for j=1:size(M_.param_names,1)
eval([deblank(M_.param_names(j,:)),' = M_.params(j);'])
assignin('base',deblank(M_.param_names(j,:)),M_.params(j));
end
for j=1:size(M_.endo_names,1)
eval([deblank(M_.endo_names(j,:)),' = NaN;'])
end
check1=0;
s=betae*delta*alph/(1-betae+delta*betae);
a=as; %as^((1-alph)/(1+theta))*(delta^((phi+theta+1)/(theta+1))/s)^alph;
k=(delta/s/a)^(1/(alph-1));
i=delta*k;
c=(((a*k^alph)^(1+theta)-s*(i/s)^(1+theta))/(1-s))^(1/(1+theta))*(1-s);
lam = (1-s)^theta/c^(1+theta)/(1+theta);
ys=[
c
k
i
a
lam
];
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment