| 1 |
// --+ options: stochastic,json=compute +-- |
| 2 |
|
| 3 |
var U2_Q_YED |
| 4 |
U2_G_YER |
| 5 |
U2_STN |
| 6 |
U2_EHIC |
| 7 |
U2_ESTN |
| 8 |
U2_G_EYER |
| 9 |
U2_HH_OCOR |
| 10 |
U2_HH_COR |
| 11 |
U2_H_Q_YER400 |
| 12 |
U2_HH_COR1 ; |
| 13 |
|
| 14 |
varexo res_U2_Q_YED |
| 15 |
res_U2_G_YER |
| 16 |
res_U2_STN |
| 17 |
res_U2_EHIC |
| 18 |
res_U2_ESTN |
| 19 |
res_U2_G_EYER |
| 20 |
res_U2_HH_OCOR |
| 21 |
res_U2_H_Q_YER |
| 22 |
res_ez ; |
| 23 |
|
| 24 |
parameters u2_q_yed_ecm_u2_q_yed_L1 |
| 25 |
u2_q_yed_ecm_u2_stn_L1 |
| 26 |
u2_q_yed_u2_q_yed_L1 |
| 27 |
u2_q_yed_u2_g_yer_L1 |
| 28 |
u2_q_yed_u2_stn_L1 |
| 29 |
u2_g_yer_ecm_u2_q_yed_L1 |
| 30 |
u2_g_yer_ecm_u2_stn_L1 |
| 31 |
u2_g_yer_u2_q_yed_L1 |
| 32 |
u2_g_yer_u2_g_yer_L1 |
| 33 |
u2_g_yer_u2_stn_L1 |
| 34 |
u2_stn_ecm_u2_q_yed_L1 |
| 35 |
u2_stn_ecm_u2_stn_L1 |
| 36 |
u2_stn_u2_q_yed_L1 |
| 37 |
u2_stn_u2_g_yer_L1 |
| 38 |
u2_q_yed_ecm_u2_g_yer_L1 |
| 39 |
u2_g_yer_ecm_u2_g_yer_L1 |
| 40 |
u2_stn_ecm_u2_g_yer_L1 |
| 41 |
u2_hh_ocor_ecm_u2_q_yed_L1 |
| 42 |
u2_hh_ocor_ecm_u2_stn_L1 |
| 43 |
u2_hh_ocor_ecm_u2_g_yer_L1 |
| 44 |
u2_hh_ocor_u2_q_yed_L1 |
| 45 |
u2_hh_ocor_u2_g_yer_L1 |
| 46 |
u2_hh_ocor_u2_stn_L1 |
| 47 |
u2_hh_ocor_ecm_u2_hh_ocor_L1 |
| 48 |
u2_hh_ocor_u2_hh_ocor_L1 |
| 49 |
beta |
| 50 |
ecm_pac |
| 51 |
u2_hh_cor_pac_u2_hh_cor_L1 ; |
| 52 |
|
| 53 |
|
| 54 |
beta = 0.98 ; |
| 55 |
ecm_pac = 0.2; |
| 56 |
u2_hh_cor_pac_u2_hh_cor_L1 = 0.4; |
| 57 |
|
| 58 |
model; |
| 59 |
|
| 60 |
[name='U2_G_YER'] |
| 61 |
diff(U2_G_YER) = u2_g_yer_ecm_u2_q_yed_L1 * (U2_Q_YED(-1) - U2_EHIC(-1)) |
| 62 |
+ u2_g_yer_ecm_u2_stn_L1 * (U2_STN(-1) - U2_ESTN(-1)) |
| 63 |
+ u2_g_yer_ecm_u2_g_yer_L1 * (U2_G_YER(-1) - U2_G_EYER(-1)) |
| 64 |
+ u2_g_yer_u2_q_yed_L1 * diff(U2_Q_YED(-1)) |
| 65 |
+ u2_g_yer_u2_g_yer_L1 * diff(U2_G_YER(-1)) |
| 66 |
+ u2_g_yer_u2_stn_L1 * diff(U2_STN(-1)) |
| 67 |
+ res_U2_G_YER ; |
| 68 |
|
| 69 |
|
| 70 |
[name='U2_Q_YED'] |
| 71 |
diff(U2_Q_YED) = u2_q_yed_ecm_u2_q_yed_L1 * (U2_Q_YED(-1) - U2_EHIC(-1)) |
| 72 |
+ u2_q_yed_ecm_u2_stn_L1 * (U2_STN(-1) - U2_ESTN(-1)) |
| 73 |
+ u2_q_yed_ecm_u2_g_yer_L1 * (U2_G_YER(-1)- U2_G_EYER(-1)) |
| 74 |
+ u2_q_yed_u2_q_yed_L1 * diff(U2_Q_YED(-1)) |
| 75 |
+ u2_q_yed_u2_g_yer_L1 * diff(U2_G_YER(-1)) |
| 76 |
+ u2_q_yed_u2_stn_L1 * diff(U2_STN(-1)) |
| 77 |
+ res_U2_Q_YED ; |
| 78 |
|
| 79 |
|
| 80 |
[name='U2_ESTN'] |
| 81 |
U2_ESTN = U2_ESTN(-1) + res_U2_ESTN ; |
| 82 |
|
| 83 |
[name='U2_EHIC'] |
| 84 |
U2_EHIC = U2_EHIC(-1) + res_U2_EHIC ; |
| 85 |
|
| 86 |
[name='U2_G_EYER'] |
| 87 |
U2_G_EYER = U2_G_EYER(-1) + res_U2_G_EYER ; |
| 88 |
|
| 89 |
[name='U2_HH_OCOR'] |
| 90 |
diff(diff(log(U2_HH_OCOR))) = u2_hh_ocor_ecm_u2_q_yed_L1 * (U2_Q_YED(-1) - U2_EHIC(-1)) |
| 91 |
+ u2_hh_ocor_ecm_u2_stn_L1 * (U2_STN(-1) - U2_ESTN(-1)) |
| 92 |
+ u2_hh_ocor_ecm_u2_g_yer_L1 * (U2_G_YER(-1) - U2_G_EYER(-1)) |
| 93 |
+ u2_hh_ocor_ecm_u2_hh_ocor_L1 * (diff(log(U2_HH_OCOR(-1))) - U2_H_Q_YER400(-1)) |
| 94 |
+ u2_hh_ocor_u2_q_yed_L1 * diff(U2_Q_YED(-1)) |
| 95 |
+ u2_hh_ocor_u2_g_yer_L1 * diff(U2_G_YER(-1)) |
| 96 |
+ u2_hh_ocor_u2_stn_L1 * diff(U2_STN(-1)) |
| 97 |
+ u2_hh_ocor_u2_hh_ocor_L1 * diff(diff(log(U2_HH_OCOR(-1)))) |
| 98 |
+ res_U2_HH_OCOR ; |
| 99 |
|
| 100 |
[name='U2_H_Q_YER400'] |
| 101 |
U2_H_Q_YER400 = U2_H_Q_YER400(-1) + res_U2_H_Q_YER; |
| 102 |
|
| 103 |
[name='U2_STN'] |
| 104 |
diff(U2_STN) = u2_stn_ecm_u2_q_yed_L1 * (U2_Q_YED(-1) - U2_EHIC(-1)) |
| 105 |
+ u2_stn_ecm_u2_stn_L1 * (U2_STN(-1) - U2_ESTN(-1)) |
| 106 |
+ u2_stn_ecm_u2_g_yer_L1 * (U2_G_YER(-1) - U2_G_EYER(-1)) |
| 107 |
+ u2_stn_u2_q_yed_L1 * diff(U2_Q_YED(-1)) |
| 108 |
+ u2_stn_u2_g_yer_L1 * diff(U2_G_YER(-1)) |
| 109 |
+ res_U2_STN ; |
| 110 |
|
| 111 |
[name='zpac'] |
| 112 |
diff(log(U2_HH_COR)) = ecm_pac*(log(U2_HH_OCOR(-1))-log(U2_HH_COR(-1))) + |
| 113 |
u2_hh_cor_pac_u2_hh_cor_L1*diff(log(U2_HH_COR(-1))) + |
| 114 |
pac_expectation(pacman) + |
| 115 |
res_ez; |
| 116 |
|
| 117 |
[name='zpac1'] |
| 118 |
diff(log(U2_HH_COR1)) = ecm_pac*(log(U2_HH_OCOR(-1))-log(U2_HH_COR1(-1))) + |
| 119 |
u2_hh_cor_pac_u2_hh_cor_L1*diff(log(U2_HH_COR1(-1))) + |
| 120 |
pac_expectation(pacman1) + |
| 121 |
res_ez; |
| 122 |
end; |
| 123 |
|
| 124 |
// Use the same calibration as in tcm6.mod. |
| 125 |
tcm6 = load('tcm6_data.mat'); |
| 126 |
M_.params = tcm6.params; |
| 127 |
|
| 128 |
|
| 129 |
trend_component_model(model_name=toto, eqtags=['U2_Q_YED', 'U2_G_YER', 'U2_STN', 'U2_EHIC', 'U2_G_EYER', 'U2_ESTN', 'U2_HH_OCOR', 'U2_H_Q_YER400'], targets=['U2_EHIC', 'U2_G_EYER', 'U2_ESTN', 'U2_H_Q_YER400']); |
| 130 |
pac_model(auxiliary_model_name=toto, discount=beta, model_name=pacman, growth = U2_H_Q_YER400); |
| 131 |
pac.initialize('pacman'); |
| 132 |
C0 = oo_.trend_component.toto.CompanionMatrix; |
| 133 |
|
| 134 |
trend_component_model(model_name=titi, eqtags=['U2_Q_YED', 'U2_G_YER', 'U2_STN', 'U2_EHIC', 'U2_G_EYER', 'U2_ESTN', 'U2_HH_OCOR', 'U2_H_Q_YER400'], targets=['U2_G_EYER', 'U2_H_Q_YER400', 'U2_ESTN', 'U2_EHIC']); |
| 135 |
pac_model(auxiliary_model_name=titi, discount=beta, model_name=pacman1, growth = U2_H_Q_YER400); |
| 136 |
pac.initialize('pacman1'); |
| 137 |
C1 = oo_.trend_component.titi.CompanionMatrix; |
| 138 |
|
| 139 |
if any(abs(C0(:)-tcm6.C0(:)))>1e-12 |
| 140 |
error('Companion matrix is not independent of the ordering of the equations.') |
| 141 |
end |
| 142 |
|
| 143 |
if any(abs(C1(:)-tcm6.C1(:)))>1e-12 |
| 144 |
error('Companion matrix is not independent of the ordering of the equations.') |
| 145 |
end |