FWIW, in a univariate TAR model the data gets re-ordered by (say) ascending values of the
threshold variable, then separate regressions get run on the 2 sub-samples. Could this be
done with an "msortby" command followed by smpl commands?
PS
________________________________________
From: gretl-users-bounces(a)lists.wfu.edu [gretl-users-bounces(a)lists.wfu.edu] On Behalf Of
Henrique Andrade [henrique.coelho(a)gmail.com]
Sent: Saturday, March 12, 2011 6:48 PM
To: Gretl list
Subject: Re: [Gretl-users] Threshold VAR: Coding Help
Em 12 de março de 2011 Allin escreveu:
On Sat, 12 Mar 2011, Henrique Andrade wrote:
*Y(t) = X(t-1) + e1(t); if z(t-d)>=tau*
*Y(t) = X(t-1) + e2(t); if z(t-d)<tau*
If it's a TVAR I _think_ it should look more like
Y_t = D1 + B1(L)Y_t + I_t*(D2 + B2(L)Y_t) + U_t
where I_t = 1 if z(t-d) >= tau, otherwise 0.
Dear Allin, I need that the errors (and variances) differ in each regime:
Y_t = D1 + B1(L)Y_t + U1_t, if z(t-d) >= tau
Y_t = D2 + B2(L)Y_t + U2_t, otherwise
So I think I need to use the threshold values to build two data segments. To do this
I'm doing something close to your script:
<script>
series z = normal()
scalar tau = 1.5
series r1 = z(-1) >= tau
series r2 = 1-r1
loop foreach i Y
series r1$i = zeromiss(r1 * $i)
series r2$i = zeromiss(r2 * $i)
endloop
list regime1 = r1PAU r1IAU r1E
list regime2 = r2PAU r2IAU r2E
</scrip>
Now I just need to estimate two separate VARs:
<script>
"VAR regime 1" <- var 1 regime1
"VAR regime 2" <- var 1 regime2
</scrip>
But we have missing observations... How can we handle this?
Finally, I would like to make one more question. Looking at your original code, we have,
in the last line, this expression: var 1 Y ; r2*. What the symbol "*" (in r2*)
means?
Best regards,
--
Henrique C. de Andrade
Doutorando em Economia Aplicada
Universidade Federal do Rio Grande do Sul
www.ufrgs.br/ppge<http://www.ufrgs.br/ppge>