File: ds2.mod

package info (click to toggle)
dynare 4.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 40,640 kB
  • sloc: fortran: 82,231; cpp: 72,734; ansic: 28,874; pascal: 13,241; sh: 4,300; objc: 3,281; yacc: 2,833; makefile: 1,288; lex: 1,162; python: 162; lisp: 54; xml: 8
file content (77 lines) | stat: -rw-r--r-- 1,589 bytes parent folder | download
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
@#define countries = 1:2
@#define assets = 1:2
var
@#for c in countries
  yk_@{c} yl_@{c} c_@{c}
@#endfor
a ze_1 r_1
;

varexo
@#for c in countries
  ek_@{c} el_@{c}
@#endfor
;

parameters rho eta omega sig_k sig_l ykbar ylbar;

rho = 1;
psi = 0.7;
eta = 0.9;
g = 0.25;
ykbar = 1;
ylbar = 1;
cbar = ykbar+ylbar;
nu = 0.5;
omega = 0.75;
sig_k = 0.02;
sig_l = 0.01;
sig_m = 0;
betabar = omega*cbar^(-eta);


model;
@#for c in countries
  yk_@{c} = log(ykbar) + sig_k*ek_@{c};
  yl_@{c} = log(ylbar) + sig_l*el_@{c};
  exp(c_@{c})^(eta-rho) = omega*exp(c_@{c}(+1))^(-rho)*r_1(+1);
@#endfor

a = a(-1)*r_1 + exp(yk_1) + exp(yl_1) - exp(c_1);
-a = -a(-1)*r_1 + exp(yk_2) + exp(yl_2) - exp(c_2);
//  r_1+ze_1  = ze_1+exp(yk_1-ze_1(-1));
  r_1  = exp(yk_1-ze_1(-1))+ze_1-ze_1;


end;

shocks;
@#for c in countries
  var ek_@{c} = 1;
  var el_@{c} = 1;
@#endfor
end;

initval;
@#for c in countries
  yk_@{c} = log(ykbar);
  yl_@{c} = log(ylbar);
  c_@{c} = log(ykbar+ylbar);
@#endfor
  r_1 = 1/betabar;
  ze_1 = log(betabar)+yk_1;
end;

resid(1);
steady;
model_diagnostics(M_,options_,oo_);
check;
stoch_simul(order=2,irf=0);

o1 = load('ds1_results','oo_');
oo1 = o1.oo_.dr;
oo2 = oo_.dr;
if any(abs(oo1.ghxx-oo2.ghxx) > 1e-14);error('ds1 with missing variable doesn''t reproduce ds2');end;
if any(abs(oo1.ghuu-oo2.ghuu) > 1e-14);error('ds1 with missing variable doesn''t reproduce ds2');end;
if any(abs(oo1.ghxu-oo2.ghxu) > 1e-14);error('ds1 with missing variable doesn''t reproduce ds2');end;
if any(abs(oo1.ghs2-oo2.ghs2) > 1e-14);error('ds1 with missing variable doesn''t reproduce ds2');end;