Skip to content
Snippets Groups Projects
Commit ee28b307 authored by Johannes Pfeifer's avatar Johannes Pfeifer
Browse files

testsuite: expand Ramsey tests to check for consistency of utility and welfare

Also increase variance to make tests more challenging

(cherry picked from commit 45772571)
parent feed9d32
Branches
Tags
1 merge request!1948Cherry-pick Ramsey fixes
...@@ -9,7 +9,7 @@ gamma = 1; ...@@ -9,7 +9,7 @@ gamma = 1;
delta = 0.012; delta = 0.012;
alpha = 0.4; alpha = 0.4;
rho = 0.95; rho = 0.95;
s = 0.007; s = 0.07; % increased by a factor of 10 from 0.007 to increase risk correction
model; model;
c^(-gamma)=beta*c(+1)^(-gamma)*(alpha*exp(z(+1))*k^(alpha-1)+1-delta); c^(-gamma)=beta*c(+1)^(-gamma)*(alpha*exp(z(+1))*k^(alpha-1)+1-delta);
......
...@@ -54,6 +54,15 @@ if abs(cond_W_hand_L_SS - planner_objective_value.conditional.steady_initial_mul ...@@ -54,6 +54,15 @@ if abs(cond_W_hand_L_SS - planner_objective_value.conditional.steady_initial_mul
error('Inaccurate conditional welfare with Lagrange multiplier set to its steady-state value'); error('Inaccurate conditional welfare with Lagrange multiplier set to its steady-state value');
end; end;
if abs(oo_.mean(strmatch('U',M_.endo_names,'exact'))-oo1.oo_.mean(strmatch('U',M1.M_.endo_names,'exact')))>1e-6
error('Utility inconsistent');
end
if abs(planner_objective_value.unconditional-oo_.mean(strmatch('U',M_.endo_names,'exact'))/(1-beta)) > 1e-6;
error('Unconditional welfare assessment does not match utility');
end;
initial_condition_states = zeros(M1.M_.endo_nbr,M1.M_.maximum_lag); initial_condition_states = zeros(M1.M_.endo_nbr,M1.M_.maximum_lag);
initial_condition_states(1:M1.M_.orig_endo_nbr,:) = repmat(oo1.oo_.dr.ys(1:M1.M_.orig_endo_nbr),1,M1.M_.maximum_lag); initial_condition_states(1:M1.M_.orig_endo_nbr,:) = repmat(oo1.oo_.dr.ys(1:M1.M_.orig_endo_nbr),1,M1.M_.maximum_lag);
shock_matrix = zeros(1,M1.M_.exo_nbr); shock_matrix = zeros(1,M1.M_.exo_nbr);
......
var k z c; var k z c U;
varexo e; varexo e;
...@@ -9,15 +9,17 @@ gamma = 1; ...@@ -9,15 +9,17 @@ gamma = 1;
delta = 0.012; delta = 0.012;
alpha = 0.4; alpha = 0.4;
rho = 0.95; rho = 0.95;
s = 0.007; s = 0.07; % increased by a factor of 10 from 0.007 to increase risk correction
model; model;
k=exp(z)*k(-1)^(alpha)-c+(1-delta)*k(-1); k=exp(z)*k(-1)^(alpha)-c+(1-delta)*k(-1);
z=rho*z(-1)+s*e; z=rho*z(-1)+s*e;
U=ln(c);
end; end;
steady_state_model; steady_state_model;
z = 0; z = 0;
U=ln(c);
end; end;
planner_objective ln(c); planner_objective ln(c);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment