| 1 |
//MODEL: |
| 2 |
//test on Dynare to find the lagrangean multipliers. |
| 3 |
//We consider a standard NK model. We use the FOCS of the competitive economy and we aim at calculating the Ramsey optimal problem. |
| 4 |
|
| 5 |
//------------------------------------------------------------------------------------------------------------------------ |
| 6 |
//1. Variable declaration |
| 7 |
//------------------------------------------------------------------------------------------------------------------------ |
| 8 |
|
| 9 |
var pai, c, n, r, a; |
| 10 |
|
| 11 |
//4 variables + 1 shock |
| 12 |
|
| 13 |
varexo u; |
| 14 |
|
| 15 |
|
| 16 |
//------------------------------------------------------------------------------------------------------------------------ |
| 17 |
// 2. Parameter declaration and calibration |
| 18 |
//------------------------------------------------------------------------------------------------------------------------- |
| 19 |
|
| 20 |
parameters beta, rho, epsilon, omega, phi, gamma; |
| 21 |
|
| 22 |
beta=0.99; |
| 23 |
gamma=3; //Frish elasticity |
| 24 |
omega=17; //price stickyness |
| 25 |
epsilon=8; //elasticity for each variety of consumption |
| 26 |
phi=1; //coefficient associated to labor effort disutility |
| 27 |
|
| 28 |
rho=0.95; //coefficient associated to productivity shock |
| 29 |
|
| 30 |
//----------------------------------------------------------------------------------------------------------------------- |
| 31 |
// 3. The model |
| 32 |
//----------------------------------------------------------------------------------------------------------------------- |
| 33 |
|
| 34 |
model(bytecode); |
| 35 |
a=rho*(a(-1))+u; |
| 36 |
1/c=beta*(1/(c(+1)))*(r/(pai(+1))); //euler |
| 37 |
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 |
| 38 |
//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 |
| 39 |
(exp(a))*n=c+(omega/2)*((pai-1)^2); |
| 40 |
end; |
| 41 |
|
| 42 |
//-------------------------------------------------------------------------------------------------------------------------- |
| 43 |
// 4. Steady state |
| 44 |
//--------------------------------------------------------------------------------------------------------------------------- |
| 45 |
|
| 46 |
initval; |
| 47 |
pai=1; |
| 48 |
r=1/beta; |
| 49 |
c=0.9671684882; |
| 50 |
n=0.9671684882; |
| 51 |
a=0; |
| 52 |
end; |
| 53 |
|
| 54 |
|
| 55 |
//--------------------------------------------------------------------------------------------------------------------------- |
| 56 |
// 5. shocks |
| 57 |
//--------------------------------------------------------------------------------------------------------------------------- |
| 58 |
|
| 59 |
shocks; |
| 60 |
var u; |
| 61 |
periods 1; |
| 62 |
values 0.008; |
| 63 |
end; |
| 64 |
|
| 65 |
//-------------------------------------------------------------------------------------------------------------------------- |
| 66 |
// 6. Ramsey problem |
| 67 |
//-------------------------------------------------------------------------------------------------------------------------- |
| 68 |
|
| 69 |
planner_objective(ln(c)-phi*((n^(1+gamma))/(1+gamma))); |
| 70 |
|
| 71 |
write_latex_static_model; |
| 72 |
|
| 73 |
ramsey_model(planner_discount=0.99); |
| 74 |
steady; |
| 75 |
|
| 76 |
perfect_foresight_setup(periods=200); |
| 77 |
perfect_foresight_solver(maxit=20); |
| 78 |
|
| 79 |
rplot r; |