Page 1 of 1

Add-ins for Recursive Regression

Posted: Mon Jun 23, 2014 7:01 pm
by Afsaneh
Hi Dear Eviews users,

I was wondering if there is any Add-ins package in the Eviews 8 that can be used for recursive regression or if I can change settings of Rolling regression in Add-ins package of the Eviews to get the recursive regression result.

Thanks

Re: Add-ins for Recursive Regression

Posted: Mon Jun 23, 2014 7:23 pm
by EViews Gareth
How are you defining recursive regression?

Re: Add-ins for Recursive Regression

Posted: Mon Jun 23, 2014 7:49 pm
by Afsaneh
Thanks a lot for your quick replay. I have 233 monthly observations for two series of variables (one independant variable: X and one dependant variable: R).My regression is R(t)= c1+c2 X(t-1). I've used 153 first observations to estimate in-sample results. I need to do one step ahead forecast as out-of-sample results, which means in a first time I should use the data from the beginning of the time series until observation number 154 to forecast R then used the data from the beginning to the observation 155 to do second out-of-sample forecast and so on to the end of the 233 observations(repeat for 79 times). As I understood if the beginning of the forecast period is constant and the forecast period expands continuously, it's a recursive regression. However in rolling regression the beginning of forecast period is changed in every forecast period).

Re: Add-ins for Recursive Regression

Posted: Mon Jun 23, 2014 8:40 pm
by EViews Gareth
That sounds like rolling regression, but anchored at start

Re: Add-ins for Recursive Regression

Posted: Tue Jun 24, 2014 3:30 am
by Afsaneh
Yes, you are right. Just installed advance rolling Add-ins and found there is an option to fix the start point. Anyway, thank you very much for your time.

Re: Add-ins for Recursive Regression

Posted: Thu Jun 26, 2014 3:18 am
by Afsaneh
I have another question. I've used the advance rolling regression from Add-ins to estimate my regressions. When the results appeared in the summary table in the link "proc" above that table another link "forecast" is now active. I'm confused now, I needed to do one step ahead forecast for my out-of-sample. The rolling regression that I've already used by assuming anchored at start is not forecasting? Do I need to use this forecast link after doing rolling regression for out-sample part of my period? I used that forecast link, but it just provide me a diagram. I really appreciate your help.

Re: Add-ins for Recursive Regression

Posted: Thu Jun 26, 2014 7:50 am
by EViews Gareth
The rolling regression add-in doesn't perform forecasting.

Re: Add-ins for Recursive Regression

Posted: Tue Jul 01, 2014 8:12 pm
by Afsaneh
Hi Gareth,

I've changed the rolling regression program that I found in the forum a little bit and used it for forecasting one period ahead out-of-sample forecast (I needed to do recursive regression).Then, for checking that my program is correct I've done manually one period ahead forecast for 24 observations and I found forecasted values are slightly different from those ones that I got from running of program in Eviews. Is that alright to see a little bit different (e.g. forecasted excess return of running program is 0.004263394, and manually forecasted one is:0.003012515).

Thanks a lot for all your helps and hints inadvance.

This is the program that I run:


'run recursive regression

' set window size
!window= 153

' set step size
!step = 1

' get size of workfile
!length = @obsrange

' declare equation for estimation
equation dyinsample

'calculate number of itteration
!nIter = @floor((!length-!window)/!step)

'matrix to store coefficient estimates
matrix(2,!nIter) coefmat ' where 2 is the number of coefficients

'series to store forecast estimates
series fcast
series resid1

'*EDITED: catching start and end points
%start = "@first" '@otod(@ifirst(ser))
%end = "@last" '@otod(@ilast(ser))

' move sample !step obs at a time
for !i = 1 to !length-!window+1-!step step !step

' set sample for estimation period
%first = @otod(@dtoo(%start))
%last = @otod(@dtoo(%start)+!i+!window-2)
smpl {%first} {%last}

' estimate equation - where the equation is r =c(1) + c(2)*dy(-1)
dyinsample.ls r c dy(-1)

' store coefficients
colplace(coefmat,dyinsample.@coefs,!i)

' 1-period-ahead forecast
%1pers = @otod(@dtoo(%start)+!i+!window-1) 'start point
%1pere = @otod(@dtoo(%start)+!i+!window) 'end point: %1pere - %1pers +1 = 1 '*EDITED
if @dtoo(%end) < @dtoo(%1pere) then 'check whether the forecast end point is greater than the workfile end point
exitloop
endif

' set smpl for forecasting period
smpl {%1pers} {%1pere}

' forecast with command *forecast* (see also *fit*)
dyinsample.forecast(f=na) yf


' set sampl to obtain the 1th period observation
smpl {%1pere} {%1pere}

' store forecasts
fcast = yf
resid1 = r - fcast
next

smpl @all
show coefmat
show fcast.line

d(noerr) yf

Re: Add-ins for Recursive Regression

Posted: Wed Jul 02, 2014 7:30 am
by EViews Gareth
No, they should be identical.