-
Notifications
You must be signed in to change notification settings - Fork 0
/
ramsey_villaverde_crra.mod
89 lines (74 loc) · 1.91 KB
/
ramsey_villaverde_crra.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
79
80
81
82
83
84
85
86
87
var Y, mcHAT, yHAT, C, L, D, N, w, PI, PIstar, R, DP, mc, beta;
varexo e;
parameters alpha, b, gamma, theta, epsilon, psi, lambda, PI_bar, R_bar, rho;
PI_bar = 1.0^(1/4);
R_bar = 1.04^(1/4);
b = PI_bar/R_bar;
alpha = 1;
theta = 0.75;
epsilon = 6;
psi = 1;
rho = 0.9;
gamma = 1;
lambda = 0.003;
model;
C = Y;
w = C^gamma*L^psi;
1 = beta(+1)*R*(C/C(+1))^gamma/PI(+1);
N = mc*Y/C^gamma +theta*beta(+1)*PI(+1)^epsilon*N(+1);
D = PIstar*(Y/C^gamma + theta*beta(+1)*PI(+1)^(epsilon-1)/PIstar(+1)*D(+1));
N/D = (epsilon-1)/epsilon;
1 = theta*(PI)^(epsilon-1) + (1-theta)*(PIstar)^(1-epsilon);
DP = theta*(PI)^epsilon*DP(-1) + (1-theta)*(PIstar)^(-epsilon);
w*L = alpha*mc*Y*DP;
Y = L^alpha/DP;
mcHAT = log(mc/STEADY_STATE(mc));
yHAT = log(Y/STEADY_STATE(Y));
log(beta)= (1-rho)*log(b) + rho*log(beta(-1)) + e;
end;
initval;
beta = b;
PI = PI_bar;
R = PI/beta;
PIstar = ((1 - theta*(PI)^(epsilon-1))/(1-theta))^(1/(1-epsilon));
DP = (1-theta)*PIstar^(-epsilon)/(1-theta*PI^(epsilon));
mc = (epsilon-1)/epsilon; % approx.(assuming flex. markup)
L = (alpha*mc*DP)^(1/(1+psi)); % approx.(assuming Y = C)
Y = L^alpha/DP;
C = Y;
w = C^gamma*L^psi;
D = PIstar*Y/C^gamma/(1-beta*theta*PI^(epsilon-1)/PIstar);
N = (epsilon-1)*D/epsilon;
end;
% planner_objective - C^(1-gamma)/(1-gamma) + L^(1+psi)/(1+psi);
planner_objective - log(C) + L^(1+psi)/(1+psi);
% planner_objective (PI-1)^2 + lambda*(mcHAT)^2;
ramsey_model(planner_discount=1.0^(1/4)/1.04^(1/4));
shocks;
var e;
periods 1:1;
values 0.02;
end;
ramsey_constraints;
R > 1;
end;
perfect_foresight_setup(periods=200);
options_.stack_solve_algo = 7;
options_.solve_algo = 10;
perfect_foresight_solver;
figure(1)
subplot(311)
plot(100*(R.^4-1));
title('R')
xlim([0 50])
hold on
subplot(312)
plot(100*(PI.^4-1));
title('PI')
xlim([0 50])
hold on
subplot(313)
plot(100*(yHAT));
title('yHAT')
xlim([0 50])
hold on