Debian Codegraph @

tests/deterministic_simulations/ramst_mshocks_vec.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 xvalues = [1.2; 0.8; 0.8];
30
31 mshocks;
32 var x;
33 periods 1:3;
34 values (xvalues);
35 end;
36
37 perfect_foresight_setup(periods=200);
38 perfect_foresight_solver;
39
40 rplot c;
41 rplot k;
42
43 if ~all(oo_.exo_simul(M_.maximum_lag+(1:3)) == [ 2.4; 1.6; 1.6]) ...
44 || ~all(oo_.exo_simul(M_.maximum_lag+(4:200)) == 2)
45 error('mshocks not correctly applied')
46 end