Debian Codegraph @

tests/deterministic_simulations/ramst_mshocks.mod

raw
1 // Test mshocks 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
14 model;
15 c + k - aa*x*k(-1)^alph - (1-delt)*k(-1);
16 c^(-gam) - (1+bet)^(-1)*(aa*alph*x(+1)*k^(alph-1) + 1 - delt)*c(+1)^(-gam);
17 end;
18
19 initval;
20 x = 2;
21 k = ((delt+bet)/(1.0*aa*x*alph))^(1/(alph-1));
22 c = aa*x*k^alph-delt*k;
23 end;
24
25 steady;
26
27 check;
28
29 mshocks;
30 var x;
31 periods 1 2:3;
32 values 1.2 0.8;
33 end;
34
35 perfect_foresight_setup(periods=200);
36 perfect_foresight_solver;
37
38 rplot c;
39 rplot k;
40
41 if ~all(oo_.exo_simul(M_.maximum_lag+(1:3)) == [ 2.4; 1.6; 1.6]) ...
42 || ~all(oo_.exo_simul(M_.maximum_lag+(4:200)) == 2)
43 error('mshocks not correctly applied')
44 end