I am trying to model a financial variable using a basic two step rolling cointegration/error correction regression model.
I have looked at UG - p.306, but seem to have issue in aligning Rhat. I have 356obs (lose two of these with difference lags) and am trying to use a 1-year moving window (240 obs - daily data).
Code: Select all
compute start = 1, end =240
clear rhat coef1 coef2 coef3 coef4 coef5 coef6
dec series EC
do i=0, 116
linreg(noprint) CNY start+i end+i EC
# constant lagCNY leadCNY lagDXY lagJPY lagRepo
set lagEC = EC{-1}
linreg(noprint,robusterrors) DCNY start+i end+i
# constant DlagCNY DlagDXY DlagJPY DlagRepo lagEC
compute coef1(end+i) = %beta(1)
compute coef2(end+i) = %beta(2)
compute coef3(end+i) = %beta(3)
compute coef4(end+i) = %beta(4)
compute coef5(end+i) = %beta(5)
compute coef6(end+i) = %beta(6)
uforecast rhat end+i-1 end+i-1
end do
Appreciate the help and advice