File: linearmodel1.mod

package info (click to toggle)
dynare 7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 79,248 kB
  • sloc: cpp: 82,011; ansic: 28,583; objc: 12,573; yacc: 5,105; pascal: 2,374; lex: 1,502; python: 1,118; sh: 1,116; makefile: 605; lisp: 162; xml: 18
file content (61 lines) | stat: -rw-r--r-- 1,703 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
// --+ options: stochastic

var y pie r;
varexo e_y e_pie;

parameters delta sigma alpha kappa gamma1 gamma2;

delta =  0.44;
kappa =  0.18;
alpha =  0.48;
sigma = -0.06;

gamma1 = 1.5;
gamma2 = 0.5;

model(use_dll);
y  = delta * y(-1)  + (1-delta)*y(+1)+sigma *(r - pie(+1)) + e_y;
pie  =   alpha * pie(-1) + (1-alpha) * pie(+1) + kappa*y + e_pie;
r = gamma1*pie+gamma2*y;
end;

shocks;
var e_y;
stderr 0.63;
var e_pie;
stderr 0.4;
end;

steady;


// Extended path simulation
options_.ep.order = 0;
[ts, oo_] = extended_path([], 100, [], options_, M_, oo_);
if ~oo_.extended_path.status
   error('Extended path algorithm failed in ep/linearmodel1.mod')
end

// Stochastic extended path simulation (should be identical to extended path because the model is linear)
options_.ep.order = 1;
[sts, oo_] = extended_path([], 100, [], options_, M_, oo_);
if ~oo_.extended_path.status
   error('Stochastic extended path simulation failed in ep/linearmodel1.mod')
end

// The generated paths should be identical (because the model is linear)
if max(max(abs(ts.data-sts.data))) > 1e-12
   error('Stochastic extended path simulation are wrong in ep/linearmodel1.mod')
end

// Stochastic extended path simulation (should be identical to extended path because the model is linear, hybrid correction )
options_.ep.hybrid = 2;
[sts, oo_] = extended_path([], 100, [], options_, M_, oo_);
if ~oo_.extended_path.status
   error('Stochastic extended path (hybrid) simulation failed in ep/linearmodel1.mod')
end

// The generated paths should be identical (because the model is linear)
if max(max(abs(ts.data-sts.data))) > 1e-12
   error('Stochastic extended path (hybrid) simulation are wrong in ep/linearmodel1.mod')
end