Page 1 of 1

rolling regression and forecast

Posted: Thu May 16, 2019 12:24 am
by Mai LÊ
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.
Can you please help me!

Re: rolling regression and forecast

Posted: Thu May 16, 2019 7:48 am
by EViews Gareth
You need to change the sample before forecasting.

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

Re: rolling regression and forecast

Posted: Fri May 17, 2019 2:38 am
by Mai LÊ
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.