Page 1 of 1

Aligning Uforecast in rolling regression

Posted: Tue Jul 08, 2014 12:25 am
by vittorio23
Hi,

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

The trouble is that I can only get it to work setting uforecast from to at end+i-1 as per program sample attached. If I set to end+i+1 there are no values and I get error message that start end sample not correctly specified.

Appreciate the help and advice

Re: Aligning Uforecast in rolling regression

Posted: Tue Jul 08, 2014 5:28 am
by TomDoan
Your problem may be:

set lagEC = EC{-1}

That should be

set lagEC = EC{1}

{-1} means lead, not lag.

Re: Aligning Uforecast in rolling regression

Posted: Tue Jul 08, 2014 8:51 am
by vittorio23
Hi Tom, many thanks for spotting the error on my part.

On methodology, assuming that I do the right unit root tests, is this simple approach satisfactory.

I read the guide and manual on johle estimation and superiority to EG, but this seems complicated for forecasting single variable one step ahead. Is this assessment correct?

Many thanks in advance

Re: Aligning Uforecast in rolling regression

Posted: Tue Jul 08, 2014 10:04 am
by TomDoan
What's LEADCNY doing in the E-G regression?

For one step, I would probably skip the VECM formulation and just go with the unrestricted VAR. The VECM makes more of a difference for multiple step forecasts, but so far as I know has no superiority in short-run forecasts where the shorter run effects tend to predominate.

Re: Aligning Uforecast in rolling regression

Posted: Wed Jul 09, 2014 10:06 am
by vittorio23
Thank you again for the advice.

I was sloppy with terminology. I was advised to try dols co integration to include lag and lead. However, when I look at the forecast results they are "too good to be true". When I drop the lead as you indicate, the results are more realistic/credible.

Re: Aligning Uforecast in rolling regression

Posted: Wed Jul 09, 2014 11:33 am
by TomDoan
DOLS involves adding current, leads and lags of the differences of the other endogenous variables. (DXY, JPY I assume).