File: example2long.mod

package info (click to toggle)
dynare 5.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 77,852 kB
  • sloc: cpp: 94,481; ansic: 28,551; pascal: 14,532; sh: 5,453; objc: 4,671; yacc: 4,442; makefile: 2,923; lex: 1,612; python: 677; ruby: 469; lisp: 156; xml: 22
file content (103 lines) | stat: -rw-r--r-- 2,022 bytes parent folder | download | duplicates (3)
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
var y, c, k, a, h, b, w;
varexo e, u;

parameters beta, rho, alpha, delta, theta, psi, tau;

alpha = 0.36;
rho   = 0.95;
tau   = 0.025;
beta  = 0.99;
delta = 0.025;
psi   = 0;
theta = 2.95;

phi   = 0.1;

model;
c*theta*h^(1+psi)=(1-alpha)*y;
k = beta*(((exp(b)*c)/(exp(b(+1))*c(+1)))
    *(exp(b(+1))*alpha*y(+1)+(1-delta)*k));
y = exp(a)*(k(-1)^alpha)*(h^(1-alpha));
k = exp(b)*(y-c)+(1-delta)*k(-1);
a = rho*a(-1)+tau*b(-1) + e;
b = tau*a(-1)+rho*b(-1) + u;
w = y
@#for i in 1:50
  + beta*(y(@{i})
@#endfor
@#for i in 1:50
  )
@#endfor
;
end;

initval;
y = 1.08068253095672;
c = 0.80359242014163;
h = 0.29175631001732;
k = 11.08360443260358;
w = y*(1-beta^51)/(1-beta);
a = 0;
b = 0;
e = 0;
u = 0;
end;

shocks;
var e; stderr 0.009;
var u; stderr 0.009;
var e, u = phi*0.009*0.009;
end;

stoch_simul;

if ~exist(['example1long' filesep 'Output' filesep 'example1long_results.mat'],'file');
   error('example1long must be run first');
end;

oo1 = load(['example1long' filesep 'Output' filesep 'example1long_results'],'oo_');

dr0 = oo1.oo_.dr;
dr = oo_.dr;

d_ghx = max(abs(dr0.ghx(:) - dr.ghx(:)));
d_ghu = max(abs(dr0.ghu(:) - dr.ghu(:)));
d_ghxx = max(abs(dr0.ghxx(:) - dr.ghxx(:)));
d_ghxu = max(abs(dr0.ghxu(:) - dr.ghxu(:)));
d_ghuu = max(abs(dr0.ghuu(:) - dr.ghuu(:)));
d_ghs2 = max(abs(dr0.ghs2 - dr.ghs2));

skipline()
disp(sprintf('ghx max. abs.  diff. is %s.', num2str(d_ghx)))
disp(sprintf('ghu max. abs.  diff. is %s.', num2str(d_ghu)))
disp(sprintf('ghxx max. abs.  diff. is %s.', num2str(d_ghxx)))
disp(sprintf('ghxu max. abs.  diff. is %s.', num2str(d_ghxu)))
disp(sprintf('ghuu max. abs.  diff. is %s.', num2str(d_ghuu)))
disp(sprintf('ghs2 max. abs.  diff. is %s.', num2str(d_ghs2)))
skipline()

epsilon = 1e-12;

if d_ghx>epsilon
   error('error in ghx')
end

if d_ghu>epsilon
   error('error in ghu')
end

if d_ghxx>epsilon
   error('error in ghxx')
end

if d_ghxu>epsilon
   error('error in ghxu')
end

if d_ghuu>epsilon
   error('error in ghuu')
end

if d_ghs2>epsilon
   error('error in ghs2')
end