Debian Codegraph @

tests/deterministic_simulations/ramst_pfwee_controlled_paths.mod

raw
1 // Performs a pf_with_expectation_errors simulation with a perfect_foresight_controlled_paths block
2 // In particular, tests that it’s possible to change the expected value of a given variable (c and y in period 4)
3
4 @#define shocks = true
5 @#include "ramst_pf_controlled_paths_common.inc"
6
7 perfect_foresight_controlled_paths(learnt_in=2004Y);
8 exogenize c;
9 periods 4:6;
10 values 1.8;
11 endogenize x;
12
13 exogenize y;
14 periods 2004Y:2006Y;
15 values 0.6;
16 endogenize e_y;
17 end;
18
19 perfect_foresight_with_expectation_errors_setup(periods=30, first_simulation_period = 2001Y);
20 perfect_foresight_with_expectation_errors_solver;
21
22 if ~oo_.deterministic_simulation.status
23 error('Perfect foresight simulation failed')
24 end
25
26 if oo_.endo_simul(1, 3) ~= 1.6 || any(oo_.endo_simul(1, 5:7) ~= 1.8) || any(oo_.endo_simul(2, 8:10) ~= 13) ...
27 || oo_.endo_simul(3, 4) ~= 0.5 || any(oo_.endo_simul(3, 5:7) ~= 0.6) || oo_.exo_simul(2, 1) ~= 1.2
28 error('Perfect foresight with expectation errors and controlled paths failed')
29 end