Debian Codegraph @

tests/pac/trend-component-30/example1.mod

raw
1 // --+ options: json=compute, stochastic +--
2
3 // Test with two PAC equations in the same file
4
5 var x1 x2 x1bar x2bar z u;
6
7 varexo ex1 ex2 ex1bar ex2bar ez eu;
8
9 parameters a_x1_0 a_x1_1 a_x1_2 a_x1_x2_1 a_x1_x2_2
10 a_x2_0 a_x2_1 a_x2_2 a_x2_x1_1 a_x2_x1_2
11 e_c_m_z e_c_m_u c_z_1 c_z_2 c_u_1 c_u_2 gamma_z gamma_u beta ;
12
13 a_x1_0 = -.9;
14 a_x1_1 = .4;
15 a_x1_2 = .3;
16 a_x1_x2_1 = .1;
17 a_x1_x2_2 = .2;
18
19
20 a_x2_0 = -.9;
21 a_x2_1 = .2;
22 a_x2_2 = -.1;
23 a_x2_x1_1 = -.1;
24 a_x2_x1_2 = .2;
25
26 beta = .2;
27 e_c_m_z = .5;
28 e_c_m_u = .6;
29 c_z_1 = .2;
30 c_z_2 = -.1;
31 c_u_1 = .2;
32 c_u_2 = -.1;
33 gamma_z = .7;
34 gamma_u = .8;
35
36 trend_component_model(model_name=toto, eqtags=['eq:x1', 'eq:x2', 'eq:x1bar', 'eq:x2bar'], targets=['eq:x1bar', 'eq:x2bar']);
37
38 pac_model(auxiliary_model_name=toto, discount=beta, model_name=pacman);
39
40 pac_model(auxiliary_model_name=toto, discount=beta, model_name=nowhereman);
41
42 model;
43
44 [name='eq:x1']
45 diff(x1) = a_x1_0*(x1(-1)-x1bar(-1)) + a_x1_1*diff(x1(-1)) + a_x1_2*diff(x1(-2)) + + a_x1_x2_1*diff(x2(-1)) + a_x1_x2_2*diff(x2(-2)) + ex1;
46
47 [name='eq:x2']
48 diff(x2) = a_x2_0*(x2(-1)-x2bar(-1)) + a_x2_1*diff(x1(-1)) + a_x2_2*diff(x1(-2)) + + a_x2_x1_1*diff(x2(-1)) + a_x2_x1_2*diff(x2(-2)) + ex2;
49
50 [name='eq:x1bar']
51 x1bar = x1bar(-1) + ex1bar;
52
53 [name='eq:x2bar']
54 x2bar = x2bar(-1) + ex2bar;
55
56 [name='eq:pac:z']
57 diff(z) = gamma_z*(e_c_m_z*(x1(-1)-z(-1)) + c_z_1*diff(z(-1)) + c_z_2*diff(z(-2)) + pac_expectation(pacman)) + (1-gamma_z)*ez;
58
59 [name='eq:pac:u']
60 diff(u) = gamma_u*(e_c_m_u*(x2(-1)-u(-1)) + c_u_1*diff(u(-1)) + c_u_2*diff(u(-2)) + pac_expectation(nowhereman)) + (1-gamma_u)*eu;
61
62
63 end;
64
65 shocks;
66 var ex1 = 1.0;
67 var ex2 = 1.0;
68 var ex1bar = 1.0;
69 var ex2bar = 1.0;
70 var ez = 1.0;
71 var eu = 1.0;
72 end;