rolling regression and forecast

For questions regarding programming in the EViews programming language.

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

Mai LÊ
Posts: 12
Joined: Mon May 06, 2019 7:09 am

rolling regression and forecast

I need to write a rolling regression and forecast for a series including data of 204 months
The idea is that I divide the whole sample into 2 halves (102 months for each half). I make regression for the first half and use that estimator to forecast the first value of the second half. Then, I update the model every month with the value of previous month.
My programming code is as follows:
================
for !i =102 to 203
smpl 1 !i
equation eq1_!i.ls return_1 c aluminum(-1)
eq1_!i.forecast returnf_1(!i+1)
next
================
I don't know why the result does not match with logics.

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

Re: rolling regression and forecast

You need to change the sample before forecasting.

You should read through this:
viewtopic.php?f=15&t=878

Mai LÊ
Posts: 12
Joined: Mon May 06, 2019 7:09 am

Re: rolling regression and forecast

My result shows that the forecasted value is the fitted value estimated for the entire sample.
But the forecasted value at a point of time should be based on the estimators of the regression at that roll.