Add-ins for Recursive Regression

For questions about EViews Add-ins available from the EViews Add-ins webpage. Note each add-in available on our webpage will have its own individual thread.

Moderators: EViews Gareth, EViews Moderator, EViews Esther

Afsaneh
Posts: 11
Joined: Sun Jun 22, 2014 6:59 am

Add-ins for Recursive Regression

Postby Afsaneh » Mon Jun 23, 2014 7:01 pm

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
Last edited by Afsaneh on Mon Jun 23, 2014 7:25 pm, edited 1 time in total.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13315
Joined: Tue Sep 16, 2008 5:38 pm

Re: Add-ins for Recursive Regression

Postby EViews Gareth » Mon Jun 23, 2014 7:23 pm

How are you defining recursive regression?
Follow us on Twitter @IHSEViews

Afsaneh
Posts: 11
Joined: Sun Jun 22, 2014 6:59 am

Re: Add-ins for Recursive Regression

Postby Afsaneh » Mon Jun 23, 2014 7:49 pm

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).

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13315
Joined: Tue Sep 16, 2008 5:38 pm

Re: Add-ins for Recursive Regression

Postby EViews Gareth » Mon Jun 23, 2014 8:40 pm

That sounds like rolling regression, but anchored at start
Follow us on Twitter @IHSEViews

Afsaneh
Posts: 11
Joined: Sun Jun 22, 2014 6:59 am

Re: Add-ins for Recursive Regression

Postby Afsaneh » Tue Jun 24, 2014 3:30 am

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.

Afsaneh
Posts: 11
Joined: Sun Jun 22, 2014 6:59 am

Re: Add-ins for Recursive Regression

Postby Afsaneh » Thu Jun 26, 2014 3:18 am

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.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13315
Joined: Tue Sep 16, 2008 5:38 pm

Re: Add-ins for Recursive Regression

Postby EViews Gareth » Thu Jun 26, 2014 7:50 am

The rolling regression add-in doesn't perform forecasting.
Follow us on Twitter @IHSEViews

Afsaneh
Posts: 11
Joined: Sun Jun 22, 2014 6:59 am

Re: Add-ins for Recursive Regression

Postby Afsaneh » Tue Jul 01, 2014 8:12 pm

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13315
Joined: Tue Sep 16, 2008 5:38 pm

Re: Add-ins for Recursive Regression

Postby EViews Gareth » Wed Jul 02, 2014 7:30 am

No, they should be identical.
Follow us on Twitter @IHSEViews


Return to “Add-in Support”

Who is online

Users browsing this forum: No registered users and 7 guests