Make the detection of the target in PAC equation more robust.

In a PAC equation, the error correction term must be written as:

β×(yₜ₋₁-xₜ₋₁)

where x is the endogenous variable determined by the equation and y
the target for x. The ordering matters, if not respected the
preprocessor wll not identify the error correction term (hence the
target) and will throw an error. The target must be an endogenous
variable or the log of an endogenous variable. For a more general
target, ie an expression, one can create an auxiliary variable.

We impose the ordering, target comes first in the error correction
term, so that the stability condition is always β>0 (this constraint
can be enforced when estimating the PAC equation).
time-shift
Stéphane Adjemian (Charybdis) 2020-07-24 17:36:31 +02:00
parent 142e58576d
commit edede274f2
Signed by: stepan
GPG Key ID: 295C1FE89E17EB3C
6 changed files with 12 additions and 12 deletions

@ -1 +1 @@
Subproject commit ca375041bb0860341aef5df1487413576973c092
Subproject commit 150e9f05d5b164b728800ed9592d75071c765fb4

View File

@ -69,6 +69,6 @@ end;
// Initialize the PAC model (build the Companion VAR representation for the auxiliary model).
pac.initialize('pacman');
if ~isequal(M_.pac.pacman.equations.(M_.pac.pacman.tag_map{strcmp(M_.pac.pacman.tag_map(:,1), 'zpac'),2}).ec.istarget, [true, false])
if ~isequal(M_.pac.pacman.equations.(M_.pac.pacman.tag_map{strcmp(M_.pac.pacman.tag_map(:,1), 'zpac'),2}).ec.istarget, [false, true])
error('ec.istarget vector is wrong.')
end

View File

@ -52,7 +52,7 @@ x1bar = x1bar(-1) + ex1bar;
x2bar = x2bar(-1) + ex2bar;
[name='zpac']
diff(z) = e_c_m*(z(-1)-x1(-1)) + c_z_1*diff(z(-1)) + c_z_2*diff(z(-2)) + pac_expectation(pacman) + ez;
diff(z) = e_c_m*(x1(-1)-z(-1)) + c_z_1*diff(z(-1)) + c_z_2*diff(z(-2)) + pac_expectation(pacman) + ez;
end;
@ -69,6 +69,6 @@ end;
// Initialize the PAC model (build the Companion VAR representation for the auxiliary model).
pac.initialize('pacman');
if ~isequal(M_.pac.pacman.equations.(M_.pac.pacman.tag_map{strcmp(M_.pac.pacman.tag_map(:,1), 'zpac'),2}).ec.istarget, [false, true])
if ~isequal(M_.pac.pacman.equations.(M_.pac.pacman.tag_map{strcmp(M_.pac.pacman.tag_map(:,1), 'zpac'),2}).ec.istarget, [true, false])
error('ec.istarget vector is wrong.')
end

View File

@ -108,15 +108,15 @@ diff(diff(log(U2_HH_OCOR))) = u2_hh_ocor_ecm_u2_q_yed_L1 * (U2_Q_YED(-1) - U2
U2_H_Q_YER400 = U2_H_Q_YER400(-1) + res_U2_H_Q_YER;
[name='zpac']
diff(log(U2_HH_COR)) = ecm_pac*(log(U2_HH_COR(-1))-log(U2_HH_OCOR(-1))) +
diff(log(U2_HH_COR)) = ecm_pac*(log(U2_HH_OCOR(-1))-log(U2_HH_COR(-1))) +
u2_hh_cor_pac_u2_hh_cor_L1*diff(log(U2_HH_COR(-1))) +
pac_expectation(pacman) +
res_ez;
[name='zpac1']
diff(log(U2_HH_COR1)) = ecm_pac*(log(U2_HH_COR1(-1))-log(U2_HH_OCOR(-1))) +
diff(log(U2_HH_COR1)) = ecm_pac*(log(U2_HH_OCOR(-1))-log(U2_HH_COR1(-1))) +
u2_hh_cor_pac_u2_hh_cor_L1*diff(log(U2_HH_COR1(-1))) +
pac_expectation(pacman1) +
pac_expectation(pacman1) +
res_ez;
end;

View File

@ -109,15 +109,15 @@ diff(U2_STN) = u2_stn_ecm_u2_q_yed_L1 * (U2_Q_YED(-1) - U2_EHIC(-1))
+ res_U2_STN ;
[name='zpac']
diff(log(U2_HH_COR)) = ecm_pac*(log(U2_HH_COR(-1))-log(U2_HH_OCOR(-1))) +
diff(log(U2_HH_COR)) = ecm_pac*(log(U2_HH_OCOR(-1))-log(U2_HH_COR(-1))) +
u2_hh_cor_pac_u2_hh_cor_L1*diff(log(U2_HH_COR(-1))) +
pac_expectation(pacman) +
res_ez;
[name='zpac1']
diff(log(U2_HH_COR1)) = ecm_pac*(log(U2_HH_COR1(-1))-log(U2_HH_OCOR(-1))) +
diff(log(U2_HH_COR1)) = ecm_pac*(log(U2_HH_OCOR(-1))-log(U2_HH_COR1(-1))) +
u2_hh_cor_pac_u2_hh_cor_L1*diff(log(U2_HH_COR1(-1))) +
pac_expectation(pacman1) +
pac_expectation(pacman1) +
res_ez;
end;

View File

@ -108,13 +108,13 @@ diff(U2_STN) = u2_stn_ecm_u2_q_yed_L1 * (U2_Q_YED(-1) - U2_EHIC(-1))
+ res_U2_STN ;
[name='zpac']
diff(log(U2_HH_COR)) = ecm_pac*(log(U2_HH_COR(-1))-log(U2_HH_OCOR(-1))) +
diff(log(U2_HH_COR)) = ecm_pac*(log(U2_HH_OCOR(-1))-log(U2_HH_COR(-1))) +
u2_hh_cor_pac_u2_hh_cor_L1*diff(log(U2_HH_COR(-1))) +
pac_expectation(pacman) +
res_ez;
[name='zpac1']
diff(log(U2_HH_COR1)) = ecm_pac*(log(U2_HH_COR1(-1))-log(U2_HH_OCOR(-1))) +
diff(log(U2_HH_COR1)) = ecm_pac*(log(U2_HH_OCOR(-1))-log(U2_HH_COR1(-1))) +
u2_hh_cor_pac_u2_hh_cor_L1*diff(log(U2_HH_COR1(-1))) +
pac_expectation(pacman1) +
res_ez;