I am writing a code to estimate a threshold cointegration model.
In the below code, "thresh_test(i)" creates an error. If just a series from the attached data set used, for example r_10, the program works.
What is the problem? How can I resolve this issue?
Thank you very much.
------------------------
Code: Select all
cal(m) 1955
all 1998:12
open data tres_coint_o.xls
data(format=xls,org=obs)
linreg r_short 1964:01 1998:12 mu; # constant r_10
dif mu / dmu
*
*
*
compute low = fix(%nobs*.15) , high = fix(%nobs*.85)
set thresh_test = mu
order thresh_test
compute thresh = thresh_test(low)
compute rss_test = 1000000.0
do i = low,high
set yy = mu - thresh_test(i)
set flag = %if(yy{1}<0,0,1)
set minus = 1 - flag
set z_plus = flag*yy{1}
set z_minus = minus*yy{1}
lin(noprint) dmu
# z_plus z_minus; * use the selected lag
if %rss < rss_test {
compute rss_test = %rss
compute thresh = thresh_test(i)
}
end do I
dis ' Threshold = ' thresh
Aaron