-
Notifications
You must be signed in to change notification settings - Fork 5
/
ModelEquations.mod
53 lines (35 loc) · 1.08 KB
/
ModelEquations.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
model;
@#for k in 1:K
[name = 'FOC sector @{k}']
ups@{k}^(1/eta) * (1 / c) * (c / c@{k})^(1 / eta)
= theta / A * n + @{K} * pi_s * I * lambda_tau * phi@{k} * ups@{k} * A / sqrt(theta);
c@{k}_dev = (c@{k}/steady_state(c@{k}) - 1);
@#endfor
@#for k in 1:K
+ c@{k}
@#endfor
= A*n;
c = (
@#for k in 1:K
+ups@{k}^(1/eta) * c@{k}^(1 - 1/eta)
@#endfor
)^(eta/(eta - 1));
tau = A / sqrt(theta) * @{K} * pi_s * I * (
@#for k in 1:K
+ phi@{k}*c@{k}*ups@{k}
@#endfor
) + pi_a * I;
lambda_tau = -betta * (Ui(1) - Us(1));
Ui = log(A/sqrt(theta)) - theta/2*(1/sqrt(theta))^2
+ betta*((1 - pi_d - pi_r) * Ui(1) + pi_r * Ur(1));
Ur = log(A/sqrt(theta)) - theta/2*(1/sqrt(theta))^2 + betta*Ur(1);
Us = log(c) - theta/2*n^2 + betta*((1 - tau)*Us(1) + tau*Ui(1));
T = S * tau;
S - S(-1) + I - (1 - pi_r - pi_d) * I(-1) = 0;
I = T(-1) + (1 - pi_r - pi_d) * I(-1) + eps;
R = R(-1) + pi_r*I(-1);
D = D(-1) + pi_d*I(-1);
dD = D - D(-1);
C = (S * c + (I + R) * A / sqrt(theta))/(A/sqrt(theta)) - 1;
N = (S * n + (I + R) * 1 / sqrt(theta))/(1/sqrt(theta)) - 1;
end;