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
Add-ins for Recursive Regression
Moderators: EViews Gareth, EViews Moderator, EViews Esther
Add-ins for Recursive Regression
Last edited by Afsaneh on Mon Jun 23, 2014 7:25 pm, edited 1 time in total.
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13315
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Add-ins for Recursive Regression
How are you defining recursive regression?
Follow us on Twitter @IHSEViews
Re: Add-ins for Recursive Regression
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).
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13315
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Add-ins for Recursive Regression
That sounds like rolling regression, but anchored at start
Follow us on Twitter @IHSEViews
Re: Add-ins for Recursive Regression
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
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.
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13315
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Add-ins for Recursive Regression
The rolling regression add-in doesn't perform forecasting.
Follow us on Twitter @IHSEViews
Re: Add-ins for Recursive Regression
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
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
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13315
- Joined: Tue Sep 16, 2008 5:38 pm
Who is online
Users browsing this forum: No registered users and 7 guests