Debian Codegraph @

tests/deterministic_simulations/ramst_shock_paths_controlled.mod

raw
1 // Simple test of the exogenize stanza (controlled paths) within shock_paths block
2
3 var c k;
4 varexo x;
5
6 parameters alph gam delt bet aa;
7 alph=0.5;
8 gam=0.5;
9 delt=0.02;
10 bet=0.05;
11 aa=0.5;
12
13 model;
14 c + k - aa*x*k(-1)^alph - (1-delt)*k(-1);
15 c^(-gam) - (1+bet)^(-1)*(aa*alph*x(+1)*k^(alph-1) + 1 - delt)*c(+1)^(-gam);
16 end;
17
18 initval;
19 x = 1;
20 k = ((delt+bet)/(1.0*aa*alph))^(1/(alph-1));
21 c = aa*k^alph-delt*k;
22 end;
23
24 steady;
25
26 shock_paths;
27 exogenize c;
28 periods 2019Y, 4:5;
29 values 1.6, 1.7;
30 endogenize x;
31 end;
32
33 perfect_foresight_setup(periods=200, first_simulation_period = 2018Y);
34 perfect_foresight_solver;
35
36 assert(oo_.endo_simul(1,3) == 1.6)
37 assert(all(oo_.endo_simul(1,5:6) == 1.7))
38 assert(isequal(find(oo_.exo_simul ~= 1), [3; 5; 6]))