-
Notifications
You must be signed in to change notification settings - Fork 0
/
ramsey_nk.mod
78 lines (62 loc) · 1.68 KB
/
ramsey_nk.mod
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
var y, pi, i, p, rr, rn;
varexo e;
parameters beta, gamma, sigma, kappa, r, rho, lambda;
% PARAMETERS
beta = 1/1.005; % quarterly time discount factor
gamma = 0; % indexation to past inflation
sigma = 2; % relative risk aversion
kappa = 0.024; % slope of the Phillips curve
lambda = 0.003; % weight on output gap in loss function
% NATURAL REAL RATE PROCESS
r = 100*(1/beta-1); % steady-state (quarterly x 100)
rho = 0.95; % persistence
model;
y = y(+1) - 1/sigma*(rr - rn);
pi-gamma*pi(-1) = beta*(pi(+1)-gamma*pi) + kappa*y;
rr = i - pi(+1);
pi = p - p(-1);
rn = r + rho*(rn(-1)-r) + e;
end;
planner_objective pi^2 + lambda*y^2 + lambda*(i-rn)^2;
ramsey_model(planner_discount=1/1.005);
initval;
rn = -r;
end;
ramsey_constraints;
i > 0;
end;
perfect_foresight_setup(periods=200);
perfect_foresight_solver(lmmcp);
cut = [2 60];
figure(1)
set(gcf,'Name','Responses to natural real rate shock')
subplot(231)
plot(4*rn)
title('$r^n_t$','FontSize',14,'interpreter','latex')
hold on
xlim([1 cut(2)])
subplot(232)
plot(4*i)
title('$i_t$','FontSize',14,'interpreter','latex')
hold on
xlim(cut)
subplot(233)
plot(4*pi)
title('$\pi_t$','FontSize',14,'interpreter','latex')
hold on
xlim(cut)
subplot(234)
plot(4*rr)
title('$r_t$','FontSize',14,'interpreter','latex')
hold on
xlim(cut)
subplot(235)
plot(y)
title('$y_t$','FontSize',14,'interpreter','latex')
hold on
xlim(cut)
subplot(236)
plot(p)
title('$p_t$','FontSize',14,'interpreter','latex')
hold on
xlim(cut)