Recursive forecasting

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

noobie_simon
Posts: 6
Joined: Tue May 24, 2011 2:32 am

Recursive forecasting

Postby noobie_simon » Tue May 24, 2011 1:47 pm

d
Last edited by noobie_simon on Wed Sep 28, 2011 2:30 pm, edited 1 time in total.

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

Re: Recursive forecasting

Postby EViews Gareth » Tue May 24, 2011 2:31 pm

I'm not sure I follow.

If you have a given equation of Y C X(-1), then you're saying that Y depends on a constant and a single one-period lagged value of X. I don't see where the recursion comes in. A forecast of Y for 1970M02 will depend on (the exogenous) value of X in 1970M01. Nothing else.
Follow us on Twitter @IHSEViews

EViews Glenn
EViews Developer
Posts: 2672
Joined: Wed Oct 15, 2008 9:17 am

Re: Recursive forecasting

Postby EViews Glenn » Tue May 24, 2011 3:18 pm

I think they want the recursive least squares solutions (one-step ahead forecasts using the recursive coefficients estimated using data up-to the forecast period).

You can do this in two ways. First, you can build a state-space model with recursive coefficients to give you all of the one-step ahead forecasts. Alternately, you can estimate your OLS model using least squares (being careful to make certain that only lagged values are on the RHS), then use the recursive residuals view to give you the residuals which you can then use to obtain the forecasts.

noobie_simon
Posts: 6
Joined: Tue May 24, 2011 2:32 am

Re: Recursive forecasting

Postby noobie_simon » Wed May 25, 2011 5:41 am

k
Last edited by noobie_simon on Wed Sep 28, 2011 2:31 pm, edited 1 time in total.

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

Re: Recursive forecasting

Postby EViews Gareth » Wed May 25, 2011 9:21 am

You might find Esther's program here:
viewtopic.php?f=15&t=878
useful. It performs rolling forecasts, which is, I think, what you're describing.
Follow us on Twitter @IHSEViews

noobie_simon
Posts: 6
Joined: Tue May 24, 2011 2:32 am

Re: Recursive forecasting

Postby noobie_simon » Wed May 25, 2011 9:56 am

k
Last edited by noobie_simon on Wed Sep 28, 2011 2:32 pm, edited 4 times in total.

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

Re: Recursive forecasting

Postby EViews Gareth » Wed May 25, 2011 10:01 am

Yep, that's exactly what Esther's rolling forecast program does.
Follow us on Twitter @IHSEViews

miksterz1
Posts: 33
Joined: Fri May 20, 2011 5:20 am

Re: Recursive forecasting

Postby miksterz1 » Wed May 25, 2011 12:00 pm

A rolling forecast is similar to a recursive forecast but different in that the recursive forecast uses an expanding window instead of a rolling window. However, if someone has written a program that does rolling forecasts it should be very easy to change it a bit to do recursive forecasts instead.

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

Re: Recursive forecasting

Postby EViews Gareth » Wed May 25, 2011 12:03 pm

True, and yes it is simple - you just anchor the start date, rather than letting it role.
Follow us on Twitter @IHSEViews

noobie_simon
Posts: 6
Joined: Tue May 24, 2011 2:32 am

Re: Recursive forecasting

Postby noobie_simon » Wed May 25, 2011 12:24 pm

k
Last edited by noobie_simon on Wed Sep 28, 2011 2:32 pm, edited 1 time in total.

miksterz1
Posts: 33
Joined: Fri May 20, 2011 5:20 am

Re: Recursive forecasting

Postby miksterz1 » Sun May 29, 2011 1:11 pm

noobie_simon wrote:
miksterz1 wrote:A rolling forecast is similar to a recursive forecast but different in that the recursive forecast uses an expanding window instead of a rolling window. However, if someone has written a program that does rolling forecasts it should be very easy to change it a bit to do recursive forecasts instead.


Yes, the difference between a rolling forecast and a recursive forecast is clear for me (although I didn't manage to express myself very well :lol: ). And the link Gareth provided will surely be of great help:)

But do you know if the method described above (just collecting the recursive coefficients provided by an in-sample regression) will provide the correct forecasts?

Again, thank you for all the help


In theory, I don't see why that wouldn't work. However, I would imagine it both more tedious and error-prone to writing a program that computes the forecast series for you.

dongyadu
Posts: 12
Joined: Mon Sep 05, 2011 7:43 pm

Re: Recursive forecasting

Postby dongyadu » Tue Sep 13, 2011 1:29 pm

noobie_simon wrote:
EViews Gareth wrote:You might find Esther's program here:
viewtopic.php?f=15&t=878
useful. It performs rolling forecasts, which is, I think, what you're describing.


Thank you for the answer, I will definetely spend some time trying to implement that basic rolling regression program. I'm sorry that the explanation of recursive forecasting is not the most precise, so I refer to the explanation in Brooks' book "Introductory Econometrics for Finance"

… a useful way around this problem is to use a recursive or rolling window, which generates a series of forecasts for a given number of steps ahead. A recursive forecasting model would be one where the initial estimation date is fixed, but additional observations are added one at a time to the estimation period. A rolling window, on the other hand, is one where the length of the in-sample period used to estimate the model is fixed, so that the start date and end date successively increase by one observation. Suppose now that only one-step-ahead forecasts are of interest. They could be produced using the following recursive and rolling window approaches:


Objective: to produce.....................................Data used to estimate model parameters
1-step-ahead forecasts for:......................Rolling window.................Recursive window
1999M1............................................1990M1--1998M12 ...............1990M1--1998M12
1999M2............................................1990M2--1999M1.................1990M1--1999M1
1999M3............................................1990M3--1999M2.................1990M1--1999M2
1999M4............................................1990M4--1999M3.................1990M1--1999M3
1999M5............................................1990M5--1999M4.................1990M1--1999M4
1999M6............................................1990M6--1999M5.................1990M1--1999M5
1999M7............................................1990M7--1999M6.................1990M1--1999M6
1999M8............................................1990M8--1999M7.................1990M1--1999M7
1999M9............................................1990M9--1999M8.................1990M1--1999M8


I hope this illustration makes my previos posts a little clearer.


Hi,

I would like to ask what is real difference between the recursive window forecasting and rolling window forecasting. which situation shall I use the recursive and which situation shall I use the rolling window forecasting?

Many Thanks

RouzbehR
Posts: 12
Joined: Fri Aug 03, 2012 12:12 pm

Re: Recursive forecasting

Postby RouzbehR » Fri Aug 10, 2012 5:10 am

Hi,

May I ask how you anchor the start date.

Best

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

Re: Recursive forecasting

Postby EViews Gareth » Fri Aug 10, 2012 8:52 am

Somewhere inside the rolling loop there will be a smpl statement that changes the sample. For a rolling window it will change the start point and the end point of the sample. If you want to anchor the start date, simply change that line so that the start date doesn't change.
Follow us on Twitter @IHSEViews

RouzbehR
Posts: 12
Joined: Fri Aug 03, 2012 12:12 pm

Re: Recursive forecasting

Postby RouzbehR » Sat Aug 11, 2012 4:03 am

Thank you so much for your reply.

I changed this this:

Code: Select all

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


To this:

Code: Select all

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


I think it should do recursively, because now the start date does not roll and is fixed. Am I right?

Best


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 31 guests