| 1 |
var c, h, pi, w, R, r_e, y, gdp, gdp_hat, k, u, g, c_hat, w_hat, y_hat, h_hat; |
| 2 |
varexo d, z, eta; |
| 3 |
|
| 4 |
parameters alpha, beta, sigma, gamma, theta, ni, tau_w, phi_p, phi_y; |
| 5 |
|
| 6 |
beta = 0.997; |
| 7 |
sigma = 2; |
| 8 |
gamma = 25; |
| 9 |
theta = 7.67; |
| 10 |
tau_w = 0.2; |
| 11 |
ni = 0.28; |
| 12 |
phi_p = 1.5; |
| 13 |
phi_y = 0.125; |
| 14 |
alpha = 0.064; |
| 15 |
|
| 16 |
model; |
| 17 |
|
| 18 |
// log-deviation of _ from its steady state value |
| 19 |
gdp_hat=log(gdp)-log(steady_state(gdp)); |
| 20 |
c_hat=log(c)-log(steady_state(c)); |
| 21 |
w_hat=log(w)-log(steady_state(w)); |
| 22 |
y_hat=log(y)-log(steady_state(y)); |
| 23 |
h_hat=log(h)-log(steady_state(h)); |
| 24 |
|
| 25 |
// real interest rate |
| 26 |
r_e=1/(beta*d(+1))-1; |
| 27 |
|
| 28 |
//FOC labor |
| 29 |
c^sigma*h^ni=w*(1-tau_w); |
| 30 |
|
| 31 |
//Euler equation 1 |
| 32 |
1=beta*d(+1)*(1+R)/(1+pi(+1))*(c/c(+1))^sigma; |
| 33 |
|
| 34 |
//Euler equation 2 |
| 35 |
0=1/(1-alpha)*(steady_state(w)/z)*h^alpha-1-gamma/theta*pi*(1+pi)+beta*d(+1)*(c/c(+1))^sigma * y(+1)/y*gamma/theta*pi(+1)*(1+pi(+1)); |
| 36 |
|
| 37 |
// Taylor rule with ZLB |
| 38 |
R=max(0,r_e+phi_p*pi+phi_y*gdp_hat); |
| 39 |
|
| 40 |
//output |
| 41 |
y=z*h^(1-alpha); |
| 42 |
|
| 43 |
//aggregate resource constraint |
| 44 |
c=(1-k-eta)*y; |
| 45 |
|
| 46 |
// resource cost of price adjustment |
| 47 |
k=(gamma/2)*(pi^2); |
| 48 |
|
| 49 |
//government purchases |
| 50 |
g=eta*y; |
| 51 |
|
| 52 |
// GDP |
| 53 |
gdp=(1-k)*y; |
| 54 |
|
| 55 |
//utility |
| 56 |
u=(c^(1-sigma))/(1-sigma)-(h^(1+ni))/(1+ni); |
| 57 |
end; |
| 58 |
|
| 59 |
initval; |
| 60 |
z=1; |
| 61 |
d=1; |
| 62 |
pi=0; |
| 63 |
k=(gamma/2)*(pi^2); |
| 64 |
r_e=1/(beta*d)-1; |
| 65 |
eta=0.2; |
| 66 |
h=1; |
| 67 |
y=z*h; |
| 68 |
g=eta*y; |
| 69 |
c=(1-k-eta)*y; |
| 70 |
w=z; |
| 71 |
gdp=(1-k)*y; |
| 72 |
R=r_e; |
| 73 |
end; |
| 74 |
|
| 75 |
steady; |
| 76 |
check; |
| 77 |
|
| 78 |
shocks; |
| 79 |
//5% preference shock |
| 80 |
var d; |
| 81 |
periods 1:10; |
| 82 |
values 1.05; |
| 83 |
|
| 84 |
//technology shock |
| 85 |
var z; |
| 86 |
periods 1:10; |
| 87 |
values 1.05; |
| 88 |
end; |
| 89 |
|
| 90 |
perfect_foresight_setup(periods=40); |
| 91 |
perfect_foresight_solver(maxit=1000); |
| 92 |
|
| 93 |
rplot gdp_hat; |
| 94 |
rplot R; |
| 95 |
if oo_.deterministic_simulation.status~=1 |
| 96 |
error('This model has no solution'); |
| 97 |
end |