Debian Codegraph @

tests/deterministic_simulations/pfwee_homotopy_linearization_condpaths.mod

raw
1 /* Example that triggers homotopy in perfect foresight simulation with
2 expectation errors + controlled paths, and tests linearization. */
3
4 @#include "pfwee_homotopy.inc"
5
6 perfect_foresight_controlled_paths(learnt_in = 7);
7 exogenize LoggedProductivity;
8 periods 8:9;
9 values 5;
10 endogenize LoggedProductivityInnovation;
11 end;
12
13 perfect_foresight_with_expectation_errors_setup(periods=200);
14 perfect_foresight_with_expectation_errors_solver(homotopy_max_completion_share = 0.8, homotopy_linearization_fallback, steady_solve_algo = 13);
15
16 if ~oo_.deterministic_simulation.status
17 error('Perfect foresight simulation failed')
18 end
19
20 if ~(all(abs(oo_.endo_simul(3, 9:10) - 5) < 1e-15) && abs(oo_.exo_simul(10) - 0.5) < 1e-15)
21 error('Homotopy with linearization and controlled paths failed')
22 end