Debian Codegraph @

tests/steady_state_operator/bytecode_test.mod

raw
1 // Tests the steady_state operator, with the bytecode
2
3 var c k w;
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(bytecode);
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 w = steady_state(k);
17 end;
18
19 initval;
20 x = 1;
21 k = ((delt+bet)/(1.0*aa*alph))^(1/(alph-1));
22 c = aa*k^alph-delt*k;
23 w = 0;
24 end;
25
26 steady(solve_algo=5);
27
28 //check;
29
30 shocks;
31 var x;
32 periods 1;
33 values 1.2;
34 end;
35
36 perfect_foresight_setup(periods=20);
37 perfect_foresight_solver(stack_solve_algo=5);
38
39 if(abs(oo_.steady_state(2) - oo_.steady_state(3)) > 1e-10)
40 error('Test failed in static M-file for steady_state')
41 end
42
43 if(abs(oo_.steady_state(2) - oo_.endo_simul(3,2)) > 1e-10)
44 error('Test failed in dynamic M-file for steady_state')
45 end
46