Commit b5bf5ed2 authored by Johannes Pfeifer's avatar Johannes Pfeifer Committed by Houtan Bastani
Browse files

Add integration tests for #1193 and #1510

(cherry picked from commit 79e510a9)
parent 627031d1
......@@ -84,6 +84,7 @@ MODFILES = \
optimal_policy/Ramsey/ramsey_ex.mod \
optimal_policy/Ramsey/ramsey_ex_initval_AR2.mod \
optimal_policy/Ramsey/ramsey_ex_aux.mod \
optimal_policy/Ramsey/ramsey_histval.mod \
optimal_policy/Ramsey/Gali_commitment.mod \
optimal_policy/RamseyConstraints/test1.mod \
discretionary_policy/dennis_1.mod \
......@@ -355,6 +356,7 @@ XFAIL_MODFILES = ramst_xfail.mod \
estimation/fs2000_stochastic_singularity_xfail.mod \
identification/ident_unit_root/ident_unit_root_xfail.mod \
steady_state/Linear_steady_state_xfail.mod \
optimal_policy/Ramsey/ramsey_histval_xfail.mod \
example1_extra_exo_xfail.mod
MFILES = initval_file/ramst_initval_file_data.m
......
% Test whether preprocessor recognizes state variables introduced by optimal policy Github #1193
var pai, c, n, r, a;
varexo u;
parameters beta, rho, epsilon, omega, phi, gamma;
beta=0.99;
gamma=3;
omega=17;
epsilon=8;
phi=1;
rho=0.95;
model;
a = rho*a(-1)+u;
1/c = beta*r/(c(+1)*pai(+1));
pai*(pai-1)/c = beta*pai(+1)*(pai(+1)-1)/c(+1)+epsilon*phi*n^(gamma+1)/omega -exp(a)*n*(epsilon-1)/(omega*c);
exp(a)*n = c+(omega/2)*(pai-1)^2;
end;
initval;
r=1;
end;
histval;
r(0)=1;
end;
steady_state_model;
a = 0;
pai = beta*r;
c = find_c(0.96,pai,beta,epsilon,phi,gamma,omega);
n = c+(omega/2)*(pai-1)^2;
end;
shocks;
var u; stderr 0.008;
var u;
periods 1;
values 1;
end;
options_.dr_display_tol=0;
planner_objective(ln(c)-phi*((n^(1+gamma))/(1+gamma)));
ramsey_policy(planner_discount=0.99,order=1,instruments=(r),periods=500);
\ No newline at end of file
% Test whether preprocessor fails if histval set future lags
var pai, c, n, r, a;
varexo u;
parameters beta, rho, epsilon, omega, phi, gamma;
beta=0.99;
gamma=3;
omega=17;
epsilon=8;
phi=1;
rho=0.95;
model;
a = rho*a(-1)+u;
1/c = beta*r/(c(+1)*pai(+1));
pai*(pai-1)/c = beta*pai(+1)*(pai(+1)-1)/c(+1)+epsilon*phi*n^(gamma+1)/omega -exp(a)*n*(epsilon-1)/(omega*c);
exp(a)*n = c+(omega/2)*(pai-1)^2;
end;
initval;
r=1;
end;
histval;
a(5)=1;
end;
steady_state_model;
a = 0;
pai = beta*r;
c = find_c(0.96,pai,beta,epsilon,phi,gamma,omega);
n = c+(omega/2)*(pai-1)^2;
end;
shocks;
var u; stderr 0.008;
var u;
periods 1;
values 1;
end;
options_.dr_display_tol=0;
planner_objective(ln(c)-phi*((n^(1+gamma))/(1+gamma)));
ramsey_policy(planner_discount=0.99,order=1,instruments=(r),periods=500);
\ 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