Testsuite: replace “simul” by “perfect_foresight_setup” + “perfect_foresight_solver”
parent
be698d5f98
commit
c3524d33d0
|
@ -72,6 +72,8 @@ end;
|
|||
|
||||
model_info;
|
||||
|
||||
simul(periods=2000, stack_solve_algo = 0,maxit=10);
|
||||
perfect_foresight_setup(periods=2000);
|
||||
perfect_foresight_solver(stack_solve_algo = 0, maxit=10);
|
||||
|
||||
rplot y;
|
||||
rplot k;
|
||||
|
|
|
@ -44,7 +44,8 @@ end;
|
|||
|
||||
steady;
|
||||
|
||||
simul(periods=200);
|
||||
perfect_foresight_setup(periods=200);
|
||||
perfect_foresight_solver;
|
||||
|
||||
if ~oo_.deterministic_simulation.status
|
||||
error('Perfect foresight simulation failed')
|
||||
|
|
|
@ -51,7 +51,8 @@ end;
|
|||
|
||||
// steady;
|
||||
|
||||
simul(periods=200);
|
||||
perfect_foresight_setup(periods=200);
|
||||
perfect_foresight_solver;
|
||||
|
||||
if ~oo_.deterministic_simulation.status
|
||||
error('Perfect foresight simulation failed')
|
||||
|
|
|
@ -17,7 +17,8 @@ end;
|
|||
check;
|
||||
|
||||
%% DETERMINISTIC SIMULATION
|
||||
simul(periods = 40, stack_solve_algo=0, maxit=100);
|
||||
perfect_foresight_setup(periods = 40);
|
||||
perfect_foresight_solver(stack_solve_algo=0, maxit=100);
|
||||
|
||||
if ~oo_.deterministic_simulation.status
|
||||
error('Perfect foresight simulation failed')
|
||||
|
|
|
@ -115,13 +115,16 @@ steady;
|
|||
|
||||
check;
|
||||
|
||||
simul(periods=300);
|
||||
perfect_foresight_setup(periods=300);
|
||||
perfect_foresight_solver;
|
||||
|
||||
endo_simul_0 = oo_.endo_simul;
|
||||
if ~oo_.deterministic_simulation.status
|
||||
error('Perfect foresight simulation failed')
|
||||
end
|
||||
|
||||
simul(linear_approximation,periods=300, stack_solve_algo=7);
|
||||
perfect_foresight_setup(periods=300);
|
||||
perfect_foresight_solver(linear_approximation, stack_solve_algo=7);
|
||||
endo_simul_1 = oo_.endo_simul;
|
||||
if ~oo_.deterministic_simulation.status
|
||||
error('Perfect foresight simulation failed')
|
||||
|
|
|
@ -27,7 +27,8 @@ end;
|
|||
check;
|
||||
|
||||
// Deterministic simulation of the model for 200 periods
|
||||
simul(periods=100, tolf=1e-12);
|
||||
perfect_foresight_setup(periods=100);
|
||||
perfect_foresight_solver(tolf=1e-12);
|
||||
|
||||
if ~oo_.deterministic_simulation.status
|
||||
error('Perfect foresight simulation failed')
|
||||
|
|
|
@ -29,7 +29,8 @@ end;
|
|||
check;
|
||||
|
||||
// Deterministic simulation of the model for 200 periods
|
||||
simul(periods=100, tolf=1e-12);
|
||||
perfect_foresight_setup(periods=100);
|
||||
perfect_foresight_solver(tolf=1e-12);
|
||||
|
||||
if ~oo_.deterministic_simulation.status
|
||||
error('Perfect foresight simulation failed')
|
||||
|
|
|
@ -52,7 +52,8 @@ values 1.2;
|
|||
end;
|
||||
|
||||
// Deterministic simulation of the model for 200 periods
|
||||
simul(periods=200);
|
||||
perfect_foresight_setup(periods=200);
|
||||
perfect_foresight_solver;
|
||||
|
||||
if ~oo_.deterministic_simulation.status
|
||||
error('Perfect foresight simulation failed')
|
||||
|
|
|
@ -27,7 +27,8 @@ periods 2;
|
|||
values 0.9;
|
||||
end;
|
||||
|
||||
simul(periods=200,maxit=100);
|
||||
perfect_foresight_setup(periods=200);
|
||||
perfect_foresight_solver(maxit=100);
|
||||
|
||||
if ~oo_.deterministic_simulation.status
|
||||
error('Perfect foresight simulation failed')
|
||||
|
|
|
@ -38,7 +38,8 @@ periods 2;
|
|||
values 0.9;
|
||||
end;
|
||||
|
||||
simul(periods=200,maxit=100);
|
||||
perfect_foresight_setup(periods=200);
|
||||
perfect_foresight_solver(maxit=100);
|
||||
|
||||
if ~oo_.deterministic_simulation.status
|
||||
error('Perfect foresight simulation failed')
|
||||
|
|
|
@ -41,7 +41,8 @@ periods 2;
|
|||
values 0.9;
|
||||
end;
|
||||
|
||||
simul(periods=200,maxit=100);
|
||||
perfect_foresight_setup(periods=200);
|
||||
perfect_foresight_solver(maxit=100);
|
||||
|
||||
if ~oo_.deterministic_simulation.status
|
||||
error('Perfect foresight simulation failed')
|
||||
|
|
|
@ -36,7 +36,8 @@ periods 2;
|
|||
values 0.9;
|
||||
end;
|
||||
|
||||
simul(periods=200,maxit=100);
|
||||
perfect_foresight_setup(periods=200);
|
||||
perfect_foresight_solver(maxit=100);
|
||||
|
||||
if ~oo_.deterministic_simulation.status
|
||||
error('Perfect foresight simulation failed')
|
||||
|
|
|
@ -41,7 +41,8 @@ periods 2;
|
|||
values 0.9;
|
||||
end;
|
||||
|
||||
simul(periods=200,maxit=100);
|
||||
perfect_foresight_setup(periods=200);
|
||||
perfect_foresight_solver(maxit=100);
|
||||
|
||||
if ~oo_.deterministic_simulation.status
|
||||
error('Perfect foresight simulation failed')
|
||||
|
|
|
@ -40,7 +40,8 @@ periods 2;
|
|||
values 0.9;
|
||||
end;
|
||||
|
||||
simul(periods=200,maxit=100);
|
||||
perfect_foresight_setup(periods=200);
|
||||
perfect_foresight_solver(maxit=100);
|
||||
|
||||
if ~oo_.deterministic_simulation.status
|
||||
error('Perfect foresight simulation failed')
|
||||
|
|
|
@ -51,7 +51,8 @@ periods 2;
|
|||
values 0.9;
|
||||
end;
|
||||
|
||||
simul(periods=200,maxit=100);
|
||||
perfect_foresight_setup(periods=200);
|
||||
perfect_foresight_solver(maxit=100);
|
||||
|
||||
if ~oo_.deterministic_simulation.status
|
||||
error('Perfect foresight simulation failed')
|
||||
|
|
|
@ -25,7 +25,8 @@ shocks;
|
|||
values 1;
|
||||
end;
|
||||
|
||||
simul(periods=10);
|
||||
perfect_foresight_setup(periods=10);
|
||||
perfect_foresight_solver;
|
||||
|
||||
if ~oo_.deterministic_simulation.status
|
||||
error('Perfect foresight simulation failed')
|
||||
|
|
|
@ -22,7 +22,8 @@ shocks;
|
|||
values 1 -1;
|
||||
end;
|
||||
|
||||
simul(periods=5);
|
||||
perfect_foresight_setup(periods=5);
|
||||
perfect_foresight_solver;
|
||||
|
||||
if ~oo_.deterministic_simulation.status
|
||||
error('Perfect foresight simulation failed')
|
||||
|
|
|
@ -35,7 +35,8 @@ periods 1 2;
|
|||
values .3 -0.1;
|
||||
end;
|
||||
|
||||
simul(periods=5);
|
||||
perfect_foresight_setup(periods=5);
|
||||
perfect_foresight_solver;
|
||||
|
||||
if ~oo_.deterministic_simulation.status
|
||||
error('Perfect foresight simulation failed')
|
||||
|
|
|
@ -22,4 +22,5 @@ shocks;
|
|||
values 1 .5 .25 .125;
|
||||
end;
|
||||
|
||||
simul(periods=4);
|
||||
perfect_foresight_setup(periods=4);
|
||||
perfect_foresight_solver;
|
||||
|
|
|
@ -69,7 +69,8 @@ histval;
|
|||
Capital(0) = CapitalSS/2;
|
||||
end;
|
||||
|
||||
simul(periods=20);
|
||||
perfect_foresight_setup(periods=20);
|
||||
perfect_foresight_solver;
|
||||
|
||||
if ~oo_.deterministic_simulation.status
|
||||
error('Perfect foresight simulation failed')
|
||||
|
|
|
@ -74,7 +74,8 @@ periods 1;
|
|||
values -0.1;
|
||||
end;
|
||||
|
||||
simul(periods=300);
|
||||
perfect_foresight_setup(periods=300);
|
||||
perfect_foresight_solver;
|
||||
|
||||
if ~oo_.deterministic_simulation.status
|
||||
error('Perfect foresight simulation failed')
|
||||
|
|
|
@ -69,7 +69,8 @@ periods 4, 5, 6, 7, 8;
|
|||
values 0.04, 0.05, 0.06, 0.07, 0.08;
|
||||
end;
|
||||
|
||||
simul(periods=300);
|
||||
perfect_foresight_setup(periods=300);
|
||||
perfect_foresight_solver;
|
||||
|
||||
if ~oo_.deterministic_simulation.status
|
||||
error('Perfect foresight simulation failed')
|
||||
|
|
|
@ -72,7 +72,8 @@ end;
|
|||
|
||||
steady;
|
||||
|
||||
simul(periods=300);
|
||||
perfect_foresight_setup(periods=300);
|
||||
perfect_foresight_solver;
|
||||
|
||||
if ~oo_.deterministic_simulation.status
|
||||
error('Perfect foresight simulation failed')
|
||||
|
|
|
@ -78,7 +78,8 @@ periods 1:5;
|
|||
values 0;
|
||||
end;
|
||||
|
||||
simul(periods=300);
|
||||
perfect_foresight_setup(periods=300);
|
||||
perfect_foresight_solver;
|
||||
|
||||
if ~oo_.deterministic_simulation.status
|
||||
error('Perfect foresight simulation failed')
|
||||
|
|
|
@ -69,14 +69,16 @@ histval;
|
|||
Capital(0) = CapitalSS/2;
|
||||
end;
|
||||
|
||||
simul(periods=500);
|
||||
perfect_foresight_setup(periods=500);
|
||||
perfect_foresight_solver;
|
||||
fff = oo_.endo_simul;
|
||||
|
||||
if ~oo_.deterministic_simulation.status
|
||||
error('Perfect foresight simulation failed')
|
||||
end
|
||||
|
||||
simul(periods=500, endogenous_terminal_period);
|
||||
perfect_foresight_setup(periods=500);
|
||||
perfect_foresight_solver(endogenous_terminal_period);
|
||||
ggg = oo_.endo_simul;
|
||||
|
||||
if ~oo_.deterministic_simulation.status
|
||||
|
|
|
@ -72,7 +72,8 @@ periods 3;
|
|||
values -0.1;
|
||||
end;
|
||||
|
||||
simul(periods=300);
|
||||
perfect_foresight_setup(periods=300);
|
||||
perfect_foresight_solver;
|
||||
|
||||
if ~oo_.deterministic_simulation.status
|
||||
error('Perfect foresight simulation failed')
|
||||
|
|
|
@ -73,7 +73,8 @@ periods 1;
|
|||
values -0.1;
|
||||
end;
|
||||
|
||||
simul(periods=300);
|
||||
perfect_foresight_setup(periods=300);
|
||||
perfect_foresight_solver;
|
||||
|
||||
if ~oo_.deterministic_simulation.status
|
||||
error('Perfect foresight simulation failed')
|
||||
|
|
|
@ -73,7 +73,8 @@ periods 1;
|
|||
values -0.1;
|
||||
end;
|
||||
|
||||
simul(periods=300);
|
||||
perfect_foresight_setup(periods=300);
|
||||
perfect_foresight_solver;
|
||||
|
||||
if ~oo_.deterministic_simulation.status
|
||||
error('Perfect foresight simulation failed')
|
||||
|
|
|
@ -89,4 +89,5 @@ end;
|
|||
steady;
|
||||
check;
|
||||
|
||||
simul(periods=500);
|
||||
perfect_foresight_setup(periods=500);
|
||||
perfect_foresight_solver;
|
||||
|
|
|
@ -70,7 +70,8 @@ end;
|
|||
|
||||
options_.simul.maxit = 100;
|
||||
|
||||
simul(periods=4000);
|
||||
perfect_foresight_setup(periods=4000);
|
||||
perfect_foresight_solver;
|
||||
|
||||
n = 100;
|
||||
|
||||
|
|
|
@ -35,4 +35,5 @@ x(0) = 0.9;
|
|||
z(-1) = 0.1;
|
||||
end;
|
||||
|
||||
simul(periods=200);
|
||||
perfect_foresight_setup(periods=200);
|
||||
perfect_foresight_solver;
|
||||
|
|
|
@ -34,7 +34,8 @@ periods 2;
|
|||
values 0.9;
|
||||
end;
|
||||
|
||||
simul(periods=200);
|
||||
perfect_foresight_setup(periods=200);
|
||||
perfect_foresight_solver;
|
||||
|
||||
if ~oo_.deterministic_simulation.status
|
||||
error('Perfect foresight simulation failed')
|
||||
|
|
|
@ -68,4 +68,5 @@ end;
|
|||
|
||||
@#include "sw-common-footer.inc"
|
||||
|
||||
simul(periods=1000, lmmcp);
|
||||
perfect_foresight_setup(periods=1000);
|
||||
perfect_foresight_solver(lmmcp);
|
||||
|
|
|
@ -67,7 +67,8 @@ end;
|
|||
|
||||
@#include "sw-common-footer.inc"
|
||||
|
||||
simul(periods=1000);
|
||||
perfect_foresight_setup(periods=1000);
|
||||
perfect_foresight_solver;
|
||||
|
||||
newton_solution_is_wrong = abs(evaluate_max_dynamic_residual(str2func('sw_newton.dynamic'), oo_.endo_simul, oo_.exo_simul, M_.params, oo_.steady_state, 1000, size(oo_.endo_simul, 1), 1, M_.lead_lag_incidence))>options_.dynatol.f;
|
||||
|
||||
|
|
|
@ -35,7 +35,8 @@ periods 1;
|
|||
values 1.2;
|
||||
end;
|
||||
|
||||
simul(periods=200);
|
||||
perfect_foresight_setup(periods=200);
|
||||
perfect_foresight_solver;
|
||||
|
||||
rplot c;
|
||||
rplot k;
|
||||
|
|
|
@ -34,7 +34,8 @@ periods 1;
|
|||
values 1.2;
|
||||
end;
|
||||
|
||||
simul(periods=200);
|
||||
perfect_foresight_setup(periods=200);
|
||||
perfect_foresight_solver;
|
||||
|
||||
dynasave('myfile') c x k;
|
||||
dynatype('myfile1.txt') c x k;
|
||||
|
|
|
@ -31,7 +31,8 @@ periods 1 2 3 4;
|
|||
values 1.1 1.2 1.3 1.4;
|
||||
end;
|
||||
|
||||
simul(periods=200);
|
||||
perfect_foresight_setup(periods=200);
|
||||
perfect_foresight_solver;
|
||||
|
||||
rplot c;
|
||||
rplot k;
|
||||
|
|
|
@ -67,7 +67,8 @@ periods 1;
|
|||
values 1.2;
|
||||
end;
|
||||
|
||||
simul(periods=20);
|
||||
perfect_foresight_setup(periods=20);
|
||||
perfect_foresight_solver;
|
||||
|
||||
if(abs(oo_.steady_state(5) - erf(1)) > 1e-10)
|
||||
error('Test failed in static @{mode_name} for erf')
|
||||
|
|
|
@ -31,7 +31,8 @@ periods 1;
|
|||
values 1.2;
|
||||
end;
|
||||
|
||||
simul(periods=200);
|
||||
perfect_foresight_setup(periods=200);
|
||||
perfect_foresight_solver;
|
||||
|
||||
rplot c;
|
||||
rplot k;
|
||||
|
|
|
@ -33,7 +33,8 @@ periods 1;
|
|||
values 1.2;
|
||||
end;
|
||||
|
||||
simul(periods=200);
|
||||
perfect_foresight_setup(periods=200);
|
||||
perfect_foresight_solver;
|
||||
|
||||
rplot c;
|
||||
rplot k;
|
||||
|
|
|
@ -32,7 +32,8 @@ periods 1:2;
|
|||
values (a);
|
||||
end;
|
||||
|
||||
simul(periods=200);
|
||||
perfect_foresight_setup(periods=200);
|
||||
perfect_foresight_solver;
|
||||
|
||||
rplot c;
|
||||
rplot k;
|
||||
|
|
|
@ -28,7 +28,8 @@ periods 1;
|
|||
values 1.2;
|
||||
end;
|
||||
|
||||
simul(periods=200);
|
||||
perfect_foresight_setup(periods=200);
|
||||
perfect_foresight_solver;
|
||||
|
||||
rplot c;
|
||||
rplot k;
|
||||
|
|
|
@ -104,8 +104,8 @@ var epsilonA1; periods 1; values 2;
|
|||
|
||||
end;
|
||||
|
||||
options_.simul.robust_lin_solve=1;
|
||||
simul( periods = 400 );
|
||||
perfect_foresight_setup(periods=400);
|
||||
perfect_foresight_solver(robust_lin_solve);
|
||||
|
||||
if ~oo_.deterministic_simulation.status
|
||||
error('Model did not solve')
|
||||
|
|
|
@ -61,5 +61,7 @@ end;
|
|||
resid;
|
||||
steady;
|
||||
|
||||
simul(periods=200, solve_algo=4);
|
||||
perfect_foresight_setup(periods=200);
|
||||
perfect_foresight_solver(solve_algo=4);
|
||||
|
||||
rplot k;
|
||||
|
|
|
@ -40,4 +40,5 @@ x=0;
|
|||
z=0;
|
||||
end;
|
||||
steady;
|
||||
simul(periods=1000,stack_solve_algo=0);
|
||||
perfect_foresight_setup(periods=1000);
|
||||
perfect_foresight_solver(stack_solve_algo=0);
|
||||
|
|
|
@ -87,7 +87,8 @@ periods 1:10;
|
|||
values 1.05;
|
||||
end;
|
||||
|
||||
simul(periods=40,maxit=1000);
|
||||
perfect_foresight_setup(periods=40);
|
||||
perfect_foresight_solver(maxit=1000);
|
||||
|
||||
rplot gdp_hat;
|
||||
rplot R;
|
||||
|
|
|
@ -87,7 +87,8 @@ periods 1:10;
|
|||
values 1.05;
|
||||
end;
|
||||
|
||||
simul(periods=40,maxit=1000);
|
||||
perfect_foresight_setup(periods=40);
|
||||
perfect_foresight_solver(maxit=1000);
|
||||
|
||||
if oo_.deterministic_simulation.status==1
|
||||
error('This model has no solution');
|
||||
|
|
|
@ -33,7 +33,8 @@ periods 1;
|
|||
values 1.2;
|
||||
end;
|
||||
|
||||
simul(periods=20);
|
||||
perfect_foresight_setup(periods=20);
|
||||
perfect_foresight_solver;
|
||||
|
||||
if(abs(oo_.steady_state(2) - oo_.steady_state(3)) > 1e-10)
|
||||
error('Test failed in static M-file for steady_state')
|
||||
|
|
|
@ -33,7 +33,8 @@ periods 1;
|
|||
values 1.2;
|
||||
end;
|
||||
|
||||
simul(periods=20, stack_solve_algo=5);
|
||||
perfect_foresight_setup(periods=20);
|
||||
perfect_foresight_solver(stack_solve_algo=5);
|
||||
|
||||
if(abs(oo_.steady_state(2) - oo_.steady_state(3)) > 1e-10)
|
||||
error('Test failed in static M-file for steady_state')
|
||||
|
|
|
@ -33,7 +33,8 @@ periods 1;
|
|||
values 1.2;
|
||||
end;
|
||||
|
||||
simul(periods=20);
|
||||
perfect_foresight_setup(periods=20);
|
||||
perfect_foresight_solver;
|
||||
|
||||
if(abs(oo_.steady_state(2) - oo_.steady_state(3)) > 1e-10)
|
||||
error('Test failed in static M-file for steady_state')
|
||||
|
|
|
@ -33,7 +33,8 @@ periods 1;
|
|||
values 1.2;
|
||||
end;
|
||||
|
||||
simul(periods=20);
|
||||
perfect_foresight_setup(periods=20);
|
||||
perfect_foresight_solver;
|
||||
|
||||
if(abs(oo_.steady_state(2) - oo_.steady_state(3)) > 1e-10)
|
||||
error('Test failed in static M-file for steady_state')
|
||||
|
|
|
@ -30,7 +30,8 @@ periods 1;
|
|||
values 1.2;
|
||||
end;
|
||||
|
||||
simul(periods=200);
|
||||
perfect_foresight_setup(periods=200);
|
||||
perfect_foresight_solver;
|
||||
|
||||
rplot c;
|
||||
rplot k;
|
||||
|
|
Loading…
Reference in New Issue