File: example1_optim.mod

package info (click to toggle)
dynare 4.4.3-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 41,356 kB
  • ctags: 15,842
  • sloc: cpp: 77,029; ansic: 29,056; pascal: 13,241; sh: 4,811; objc: 3,061; yacc: 3,013; makefile: 1,479; lex: 1,258; python: 162; lisp: 54; xml: 8
file content (43 lines) | stat: -rw-r--r-- 904 bytes parent folder | download | duplicates (7)
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
// this is a file trying to replicate example1.mod as optimization of a social planner
// it serves also as an example combining +2 lead and optimal policy

var Y, C, K, A, H, B;

varexo EPS, NU;

parameters rho, beta, alpha, delta, theta, psi, tau;
alpha = 0.36;
rho   = 0.95;
tau   = 0.025;
beta  = 1/(1.03^0.25);
delta = 0.025;
psi   = 0;
theta = 2.95;

planner_objective log(C)-theta*H^(1+psi)/(1+psi);

planner_discount beta;

model;
//Y = exp(A)*K^alpha*H^(1-alpha);
Y = exp(A)*exp(A(+1))*exp(A(+2))*K^alpha*H^(1-alpha);
K = exp(B(-1))*(Y(-1)-C(-1)) + (1-delta)*K(-1);
A = rho*A(-1) + tau*B(-1) + EPS;
B = tau*A(-1) + rho*B(-1) + NU;
end;

initval;
A = 0;
B = 0;
H = ((1-alpha)/(theta*(1-(delta*alpha)/(1/beta-1+delta))))^(1/(1+psi));
Y = (alpha/(1/beta-1+delta))^(alpha/(1-alpha))*H;
K = alpha/(1/beta-1+delta)*Y;
C = Y - delta*K;
end;

vcov = [
  0.0002  0.00005;
  0.00005 0.0001
];

order = 2;