Debian Codegraph @

tests/deterministic_simulations/ramst_pf_controlled_paths_check.mod

raw
1 /* Checks that exogenous computed by ramst_pf_controlled_paths{,lbj,ssa7}.mod actually give back the
2 expected endogenous variables */
3
4 @#define shocks = false
5 @#include "ramst_pf_controlled_paths_common.inc"
6
7
8 // stack_solve_algo=0
9
10 S0 = load('ramst_pf_controlled_paths/Output/ramst_pf_controlled_paths_results.mat');
11
12 perfect_foresight_setup(periods=30);
13
14 oo_.exo_simul = S0.oo_.exo_simul;
15
16 perfect_foresight_solver;
17
18 if max(max(abs(oo_.endo_simul - S0.oo_.endo_simul))) > options_.dynatol.x
19 error('perfect_foresight_controlled_paths gives wrong result with stack_solve_algo=0')
20 end
21
22
23 // stack_solve_algo=1
24
25 S1 = load('ramst_pf_controlled_paths_lbj/Output/ramst_pf_controlled_paths_lbj_results.mat');
26
27 perfect_foresight_setup(periods=30);
28
29 oo_.exo_simul = S1.oo_.exo_simul;
30
31 perfect_foresight_solver;
32
33 if max(max(abs(oo_.endo_simul - S1.oo_.endo_simul))) > options_.dynatol.x
34 error('perfect_foresight_controlled_paths gives wrong result with stack_solve_algo=1')
35 end
36
37
38 // stack_solve_algo=7
39
40 S7 = load('ramst_pf_controlled_paths_ssa7/Output/ramst_pf_controlled_paths_ssa7_results.mat');
41
42 perfect_foresight_setup(periods=30);
43
44 oo_.exo_simul = S7.oo_.exo_simul;
45
46 perfect_foresight_solver;
47
48 if max(max(abs(oo_.endo_simul - S7.oo_.endo_simul))) > options_.dynatol.x
49 error('perfect_foresight_controlled_paths gives wrong result with stack_solve_algo=7')
50 end