Aligning Uforecast in rolling regression

Use this forum to post questions about syntax problems or general programming issues. Questions on implementing a particular aspect of econometrics should go in "Econometrics Issues" below.
vittorio23
Posts: 8
Joined: Fri Apr 17, 2009 10:12 pm

Aligning Uforecast in rolling regression

Unread post 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
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Aligning Uforecast in rolling regression

Unread post by TomDoan »

Your problem may be:

set lagEC = EC{-1}

That should be

set lagEC = EC{1}

{-1} means lead, not lag.
vittorio23
Posts: 8
Joined: Fri Apr 17, 2009 10:12 pm

Re: Aligning Uforecast in rolling regression

Unread post 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
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Aligning Uforecast in rolling regression

Unread post 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.
vittorio23
Posts: 8
Joined: Fri Apr 17, 2009 10:12 pm

Re: Aligning Uforecast in rolling regression

Unread post 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.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Aligning Uforecast in rolling regression

Unread post by TomDoan »

DOLS involves adding current, leads and lags of the differences of the other endogenous variables. (DXY, JPY I assume).
Post Reply