Debian Codegraph @

tests/optimal_policy/nk_ramsey_expectation.mod

raw
1 //MODEL:
2 // test for using expectation operator with Ramsey policy
3 // The results is validated by comparing with replacing manually the expectation with an
4 // auxiliary variable in nk_ramsey_expectation_a.mod
5 // Note that the example doesn't make any sense from an economic point of view.
6
7
8 //------------------------------------------------------------------------------------------------------------------------
9 //1. Variable declaration
10 //------------------------------------------------------------------------------------------------------------------------
11
12 var pai, c, n, r, a;
13
14 //4 variables + 1 shock
15
16 varexo u;
17
18
19
20
21 //------------------------------------------------------------------------------------------------------------------------
22 // 2. Parameter declaration and calibration
23 //-------------------------------------------------------------------------------------------------------------------------
24
25 parameters beta, rho, epsilon, omega, phi, gamma;
26
27 beta=0.99;
28 gamma=3; //Frish elasticity
29 omega=17; //price stickyness
30 epsilon=8; //elasticity for each variety of consumption
31 phi=1; //coefficient associated to labor effort disutility
32
33 rho=0.95; //coefficient associated to productivity shock
34
35
36 //-----------------------------------------------------------------------------------------------------------------------
37 // 3. The model
38 //-----------------------------------------------------------------------------------------------------------------------
39
40
41 model;
42
43
44 a=rho*(a(-1))+u;
45
46 1/c=beta*(1/(c(+1)))*(r/expectation(0)(pai(+1))); //euler
47
48
49 omega*pai*(pai-1)=beta*omega*(c/(c(+1)))*(pai(+1))*(pai(+1)-1)+epsilon*exp(a)*n*(c/exp(a)*phi*n^gamma-(epsilon-1)/epsilon); //NK pc
50 //pai*(pai-1)/c = beta*pai(+1)*(pai(+1)-1)/c(+1)+epsilon*phi*n^(gamma+1)/omega-exp(a)*n*(epsilon-1)/(omega*c); //NK pc
51
52 (exp(a))*n=c+(omega/2)*((pai-1)^2);
53
54 end;
55
56 //--------------------------------------------------------------------------------------------------------------------------
57 // 4. Steady state
58 //---------------------------------------------------------------------------------------------------------------------------
59
60 initval;
61 % this is the exact steady state under optimal policy
62 %important for the comparison
63
64 pai=1;
65 r=1/beta;
66 c=((epsilon-1)/(epsilon*phi))^(1/(1+gamma));
67 n=c;
68 a=0;
69
70 end;
71
72
73
74 //---------------------------------------------------------------------------------------------------------------------------
75 // 5. shocks
76 //---------------------------------------------------------------------------------------------------------------------------
77
78 shocks;
79 var u; stderr 0.008;
80
81 end;
82
83 //--------------------------------------------------------------------------------------------------------------------------
84 // 6. Ramsey problem
85 //--------------------------------------------------------------------------------------------------------------------------
86
87 planner_objective(ln(c)-phi*((n^(1+gamma))/(1+gamma)));
88
89 write_latex_static_model;
90 write_latex_dynamic_model;
91
92 options_.solve_tolf=1e-12;
93 ramsey_model(planner_discount=0.99);
94 stoch_simul(order=1,irf=0);
95 evaluate_planner_objective;
96