Debian Codegraph @

tests/ep/linearmodel1.mod

raw
1 // --+ options: stochastic
2
3 var y pie r;
4 varexo e_y e_pie;
5
6 parameters delta sigma alpha kappa gamma1 gamma2;
7
8 delta = 0.44;
9 kappa = 0.18;
10 alpha = 0.48;
11 sigma = -0.06;
12
13 gamma1 = 1.5;
14 gamma2 = 0.5;
15
16 model(use_dll);
17 y = delta * y(-1) + (1-delta)*y(+1)+sigma *(r - pie(+1)) + e_y;
18 pie = alpha * pie(-1) + (1-alpha) * pie(+1) + kappa*y + e_pie;
19 r = gamma1*pie+gamma2*y;
20 end;
21
22 shocks;
23 var e_y;
24 stderr 0.63;
25 var e_pie;
26 stderr 0.4;
27 end;
28
29 steady;
30
31
32 // Extended path simulation
33 options_.ep.order = 0;
34 [ts, oo_] = extended_path([], 100, [], options_, M_, oo_);
35 if ~oo_.extended_path.status
36 error('Extended path algorithm failed in ep/linearmodel1.mod')
37 end
38
39 // Stochastic extended path simulation (should be identical to extended path because the model is linear)
40 options_.ep.order = 1;
41 [sts, oo_] = extended_path([], 100, [], options_, M_, oo_);
42 if ~oo_.extended_path.status
43 error('Stochastic extended path simulation failed in ep/linearmodel1.mod')
44 end
45
46 // The generated paths should be identical (because the model is linear)
47 if max(max(abs(ts.data-sts.data))) > 1e-12
48 error('Stochastic extended path simulation are wrong in ep/linearmodel1.mod')
49 end
50
51 // Stochastic extended path simulation (should be identical to extended path because the model is linear, hybrid correction )
52 options_.ep.hybrid = 2;
53 [sts, oo_] = extended_path([], 100, [], options_, M_, oo_);
54 if ~oo_.extended_path.status
55 error('Stochastic extended path (hybrid) simulation failed in ep/linearmodel1.mod')
56 end
57
58 // The generated paths should be identical (because the model is linear)
59 if max(max(abs(ts.data-sts.data))) > 1e-12
60 error('Stochastic extended path (hybrid) simulation are wrong in ep/linearmodel1.mod')
61 end