On Thu, 5 Apr 2012, Hanne holopainen wrote:
Hi again,
Thanks for help ! And yes, I mean that Shin et al -version of asymmetric
ECM, in this case with two explanatory variables and a couple of dummies.
Maybe the following example script may help:
<hansl>
open AWM.gdt --quiet
series infl = 400*ldiff(HICP)
# known beta -----------------------------
series z1 = STN - infl
z1 -= mean(z1)
series z2 = LTN - infl
z2 -= mean(z2)
list A_ECM = null
loop foreach i z1 z2
series $ip = ($i>0) ? $i : 0
series $im = ($i<=0) ? $i : 0
list A_ECM += $ip(-1) $im(-1)
end loop
list X = infl STN LTN
list DX = diff(X)
list DLAGS = lags(1,DX)
system name ="AsyVECM"
equation d_infl const DLAGS A_ECM
equation d_STN const DLAGS A_ECM
equation d_LTN const DLAGS A_ECM
end system
estimate "AsyVECM" method=ols
# unknown beta ---------------------------
ols d_STN const DLAGS --quiet
gam = $coeff
scalar a11 = 0
scalar a12 = 0
scalar a21 = 0
scalar a22 = 0
scalar b1 = 1
scalar b2 = 1
nls d_STN = gam[1] + lincomb(DLAGS, gam[2:]) + ec(-1)
series ec = 0
series z1 = STN - b1 * infl
series z2 = STN - b2 * LTN
series ec = (z1>0) ? a11 * z1 : a12 * z1
series ec += (z2>0) ? a21 * z2 : a22 * z2
params gam a11 a12 a21 a22 b1 b2
end nls
</hansl>
Don't be too picky about the economics or the econometrics in the example,
it's just to show you how you can use hansl to do a few things that you
may find useful. :)
Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti