Debian Codegraph @

tests/solve_algo_12_14/purely_forward_common.inc

raw
1 /* A simple purely forward model, consisting of:
2 - a forward VAR(3) with one variable in level, one in log and one log-forward-differentiated;
3 - two other variables that depend on the contemporaneous values of the VAR(3),
4 and which together for a simultaneous block.
5 Those five equations are repeated an arbitrary number of times (n). */
6
7 @#define n = 10
8
9 @#for i in 1:n
10 var x@{i}, y@{i}, z@{i}, t@{i}, s@{i};
11 varexo e_x@{i}, e_y@{i}, e_z@{i}, e_t@{i}, e_s@{i};
12 @#endfor
13
14 model;
15 @#for i in 1:n
16 x@{i} = 0.1*x@{i}(+1) + 0.2*log(y@{i}(+1)) + 0.3*(log(z@{i})-log(z@{i}(+1))) + e_x@{i};
17 [name = 'y']
18 log(y@{i}) = 0.4*x@{i}(+1) + 0.5*log(y@{i}(+1)) + 0.6*(log(z@{i})-log(z@{i}(+1))) + e_y@{i};
19 [name = 'z']
20 /* NB: we choose 0.5 as steady state for z, since initial value is drawn from
21 [0,1] (in the “simul_backward” case) */
22 log(z@{i})-log(z@{i}(+1)) = -0.8*(log(z@{i}(+1)) - log(0.5)) + 0.1*x@{i}(+1) + 0.2*log(y@{i}(+1)) - 0.3*(log(z@{i}) - log(z@{i}(+1))) + e_z@{i};
23
24 t@{i} = x@{i} + 2*log(y@{i}) + 3*(log(z@{i})-log(z@{i}(+1))) + s@{i} + e_t@{i};
25 s@{i} = 4*x@{i}(+1) + 3*t@{i} + e_s@{i};
26 @#endfor
27 end;
28
29 initval;
30 @#for i in 1:n
31 y@{i} = 1;
32 z@{i} = 0.5;
33 @#endfor
34 end;
35
36 shocks;
37 @#for i in 1:n
38 var e_x@{i};
39 periods 99;
40 values @{0.1/n};
41
42 var e_y@{i};
43 periods 98;
44 values @{0.05+0.1/n};
45
46 var e_z@{i};
47 periods 97;
48 values @{0.1+0.1/n};
49
50 var e_t@{i};
51 periods 96;
52 values @{0.15+0.1/n};
53
54 var e_s@{i};
55 periods 95;
56 values @{0.2+0.1/n};
57 @#endfor
58 end;
59
60 perfect_foresight_setup(periods = 100);