Debian Codegraph @

tests/solve_algo_12_14/backward_model.inc

raw
1 /* A simple purely backward model, used for testing both “simul_backward” and
2 perfect foresight simulations, consisting of:
3 - a VAR(3) with one variable in level, one in log and one log-differentiated;
4 - two other variables that depend on the contemporaneous values of the VAR(3),
5 and which together for a simultaneous block.
6 Those five equations are repeated an arbitrary number of times (n). */
7
8 @#define n = 10
9
10 @#for i in 1:n
11 var x@{i}, y@{i}, z@{i}, t@{i}, s@{i};
12 varexo e_x@{i}, e_y@{i}, e_z@{i}, e_t@{i}, e_s@{i};
13 @#endfor
14
15 model(use_dll);
16 @#for i in 1:n
17 x@{i} = 0.1*x@{i}(-1) + 0.2*log(y@{i}(-1)) + 0.3*diff(log(z@{i}(-1))) + e_x@{i};
18 [name = 'y']
19 log(y@{i}) = 0.4*x@{i}(-1) + 0.5*log(y@{i}(-1)) + 0.6*diff(log(z@{i}(-1))) + e_y@{i};
20 [name = 'z']
21 /* NB: we choose 0.5 as steady state for z, since initial value is drawn from
22 [0,1] (in the “simul_backward” case) */
23 diff(log(z@{i})) = -0.8*(log(z@{i}(-1)) - log(0.5)) + 0.1*x@{i}(-1) + 0.2*log(y@{i}(-1)) - 0.3*diff(log(z@{i}(-1))) + e_z@{i};
24
25 t@{i} = x@{i} + 2*log(y@{i}) + 3*diff(log(z@{i})) + s@{i} + e_t@{i};
26 s@{i} = 4*x@{i}(-1) + 3*t@{i} + e_s@{i};
27 @#endfor
28 end;