Add unit tests for correctness of identification results when only standard deviations are estimated
Compares results for standard deviations specified with varexo to results when specified as deep parametertime-shift
parent
446b1f6dc1
commit
fbaf27493c
|
@ -125,6 +125,8 @@ MODFILES = \
|
|||
identification/kim/kim2.mod \
|
||||
identification/as2007/as2007.mod \
|
||||
identification/ident_unit_root/ident_unit_root.mod \
|
||||
identification/rbc_ident/rbc_ident_std_as_structural_par.mod \
|
||||
identification/rbc_ident/rbc_ident_varexo_only.mod \
|
||||
simul/example1.mod \
|
||||
simul/Solow_no_varexo.mod \
|
||||
simul/simul_ZLB_purely_forward.mod \
|
||||
|
@ -305,6 +307,8 @@ deterministic_simulations/rbc_det_exo_lag_2c.o.trs: deterministic_simulations/rb
|
|||
initval_file/ramst_initval_file.m.trs: initval_file/ramst_initval_file_data.m.tls
|
||||
initval_file/ramst_initval_file.o.trs: initval_file/ramst_initval_file_data.o.tls
|
||||
|
||||
identification/rbc_ident/rbc_ident_varexo_only.m.trs: identification/rbc_ident/rbc_ident_std_as_structural_par.m.trs
|
||||
identification/rbc_ident/rbc_ident_varexo_only.o.trs: identification/rbc_ident/rbc_ident_std_as_structural_par.o.trs
|
||||
|
||||
|
||||
# Matlab TRS Files
|
||||
|
|
|
@ -0,0 +1,95 @@
|
|||
% Real Business Cycle Model
|
||||
|
||||
close all;
|
||||
|
||||
%----------------------------------------------------------------
|
||||
% 1. Defining variables
|
||||
%----------------------------------------------------------------
|
||||
|
||||
var y c k l x z g ysim xsim;
|
||||
|
||||
varexo eps_z eps_g;
|
||||
parameters gn gz betta delta psi sigma theta rho_z eps_z_sigma rho_g eps_g_sigma q12 zbar gbar;
|
||||
|
||||
|
||||
%----------------------------------------------------------------
|
||||
% 2. Calibration
|
||||
%----------------------------------------------------------------
|
||||
|
||||
gn = 0.00243918275778010;
|
||||
gz = 0.00499789993972673;
|
||||
betta = 0.9722^(1/4)/(1+gz);
|
||||
delta = 1-(1-0.0464)^(1/4);
|
||||
psi = 2.24;
|
||||
sigma = 1.000001;
|
||||
theta = 0.35;
|
||||
|
||||
zbar = 0.0023;
|
||||
gbar = -0.0382;
|
||||
|
||||
rho_z = 0.8;
|
||||
sig_z = 0.0086;
|
||||
rho_g = 0.8;
|
||||
sig_g = 0.0248;
|
||||
|
||||
q12 = -0.0002;
|
||||
|
||||
|
||||
|
||||
%----------------------------------------------------------------
|
||||
% 3. Model
|
||||
%----------------------------------------------------------------
|
||||
|
||||
|
||||
model;
|
||||
% Intratemporal Optimality Condition
|
||||
(psi*c)/(1-l) = (1-theta)*(k(-1)^theta)*(l^(-theta))*(exp(z)^(1-theta));
|
||||
% Intertemporal Optimality Condition
|
||||
(c^(-sigma))*((1-l)^(psi*(1-sigma))) = betta*((c(+1))^(-sigma))*((1-l(+1))^(psi*(1-sigma)))*(theta*(k^(theta-1))*((exp(z(+1))*l(+1))^(1-theta))+(1-delta));
|
||||
% Aggregate Resource Constraint
|
||||
y = c + exp(g) + x;
|
||||
% Capital Accumulation Law
|
||||
(1+gz)*(1+gn)*k = (1-delta)*k(-1) + x;
|
||||
% Production Function
|
||||
y = (k(-1)^theta)*((exp(z)*l)^(1-theta));
|
||||
|
||||
% Stochastic Processes
|
||||
z = zbar + rho_z*z(-1) + eps_z_sigma*eps_z;
|
||||
g = gbar + rho_g*g(-1) + eps_g_sigma*eps_g;
|
||||
|
||||
ysim = y;
|
||||
xsim = x;
|
||||
|
||||
end;
|
||||
|
||||
|
||||
%----------------------------------------------------------------
|
||||
% 4. Computation
|
||||
%----------------------------------------------------------------
|
||||
|
||||
|
||||
shocks;
|
||||
var eps_z ; stderr 1;
|
||||
var eps_g ; stderr 1;
|
||||
end;
|
||||
|
||||
|
||||
initval;
|
||||
z = 0;
|
||||
k = (betta*theta)^(1/(1-theta))*exp(zbar/(1-rho_z));
|
||||
c = (1-betta*theta)/(betta*theta)*k;
|
||||
y = exp(zbar/(1-rho_z))^(1-theta)*k^theta;
|
||||
l = k/(((1-betta*(1-delta))/(betta*theta*(exp(zbar/(1-rho_z))^(1-theta))))^(1/(theta-1)));
|
||||
end;
|
||||
|
||||
|
||||
estimated_params;
|
||||
eps_z_sigma, 0.0001, 0,10;
|
||||
eps_g_sigma, 0.0001, 0,10;
|
||||
% betta, 0.9722^(1/4)/(1+gz),0,1;
|
||||
%corr eps_z, eps_g, 0.0001, -1,1;
|
||||
end;
|
||||
|
||||
varobs ysim xsim;
|
||||
|
||||
identification(advanced=1);
|
|
@ -0,0 +1,105 @@
|
|||
% Real Business Cycle Model
|
||||
|
||||
close all;
|
||||
|
||||
%----------------------------------------------------------------
|
||||
% 1. Defining variables
|
||||
%----------------------------------------------------------------
|
||||
|
||||
var y c k l x z g ysim xsim;
|
||||
|
||||
varexo eps_z eps_g;
|
||||
parameters gn gz betta delta psi sigma theta rho_z sig_z rho_g sig_g q12 zbar gbar;
|
||||
|
||||
|
||||
%----------------------------------------------------------------
|
||||
% 2. Calibration
|
||||
%----------------------------------------------------------------
|
||||
|
||||
gn = 0.00243918275778010;
|
||||
gz = 0.00499789993972673;
|
||||
betta = 0.9722^(1/4)/(1+gz);
|
||||
delta = 1-(1-0.0464)^(1/4);
|
||||
psi = 2.24;
|
||||
sigma = 1.000001;
|
||||
theta = 0.35;
|
||||
|
||||
zbar = 0.0023;
|
||||
gbar = -0.0382;
|
||||
|
||||
rho_z = 0.8;
|
||||
sig_z = 0.0086;
|
||||
rho_g = 0.8;
|
||||
sig_g = 0.0248;
|
||||
|
||||
q12 = -0.0002;
|
||||
|
||||
|
||||
|
||||
%----------------------------------------------------------------
|
||||
% 3. Model
|
||||
%----------------------------------------------------------------
|
||||
|
||||
|
||||
model;
|
||||
% Intratemporal Optimality Condition
|
||||
(psi*c)/(1-l) = (1-theta)*(k(-1)^theta)*(l^(-theta))*(exp(z)^(1-theta));
|
||||
% Intertemporal Optimality Condition
|
||||
(c^(-sigma))*((1-l)^(psi*(1-sigma))) = betta*((c(+1))^(-sigma))*((1-l(+1))^(psi*(1-sigma)))*(theta*(k^(theta-1))*((exp(z(+1))*l(+1))^(1-theta))+(1-delta));
|
||||
% Aggregate Resource Constraint
|
||||
y = c + exp(g) + x;
|
||||
% Capital Accumulation Law
|
||||
(1+gz)*(1+gn)*k = (1-delta)*k(-1) + x;
|
||||
% Production Function
|
||||
y = (k(-1)^theta)*((exp(z)*l)^(1-theta));
|
||||
|
||||
% Stochastic Processes
|
||||
z = zbar + rho_z*z(-1) + eps_z;
|
||||
g = gbar + rho_g*g(-1) + eps_g;
|
||||
|
||||
ysim = y;
|
||||
xsim = x;
|
||||
|
||||
end;
|
||||
|
||||
|
||||
%----------------------------------------------------------------
|
||||
% 4. Computation
|
||||
%----------------------------------------------------------------
|
||||
|
||||
|
||||
shocks;
|
||||
var eps_z ; stderr sig_z;
|
||||
var eps_g ; stderr sig_g;
|
||||
end;
|
||||
|
||||
|
||||
initval;
|
||||
z = 0;
|
||||
k = (betta*theta)^(1/(1-theta))*exp(zbar/(1-rho_z));
|
||||
c = (1-betta*theta)/(betta*theta)*k;
|
||||
y = exp(zbar/(1-rho_z))^(1-theta)*k^theta;
|
||||
l = k/(((1-betta*(1-delta))/(betta*theta*(exp(zbar/(1-rho_z))^(1-theta))))^(1/(theta-1)));
|
||||
end;
|
||||
|
||||
|
||||
estimated_params;
|
||||
stderr eps_z, 0.0001, 0,10;
|
||||
stderr eps_g, 0.0001, 0,10;
|
||||
% betta, 0.9,0,1;
|
||||
%corr eps_z, eps_g, 0.0001, -1,1;
|
||||
end;
|
||||
|
||||
varobs ysim xsim;
|
||||
|
||||
identification(advanced=1);
|
||||
temp=load([M_.dname filesep 'identification' filesep M_.fname '_ML_Starting_value_identif'])
|
||||
temp_comparison=load(['rbc_ident_std_as_structural_par' filesep 'identification' filesep 'rbc_ident_std_as_structural_par' '_ML_Starting_value_identif'])
|
||||
|
||||
if max(abs(temp.idehess_point.ide_strength_J - temp_comparison.idehess_point.ide_strength_J))>1e-8 ||...
|
||||
max(abs(temp.idehess_point.deltaM - temp_comparison.idehess_point.deltaM))>1e-8 ||...
|
||||
max(abs(temp.idemoments_point.GAM- temp.idemoments_point.GAM))>1e-8 ||...
|
||||
max(abs(temp.idemoments_point.GAM- temp.idemoments_point.GAM))>1e-8
|
||||
error('Results do not match')
|
||||
|
||||
end
|
Loading…
Reference in New Issue