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: 18
Joined: Mon May 06, 2019 7:09 am

rolling regression and forecast

Postby Mai LÊ » Thu May 16, 2019 12:24 am

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!

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

Re: rolling regression and forecast

Postby EViews Gareth » Thu May 16, 2019 7:48 am

You need to change the sample before forecasting.

You should read through this:
viewtopic.php?f=15&t=878
Follow us on Twitter @IHSEViews

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

Re: rolling regression and forecast

Postby Mai LÊ » Fri May 17, 2019 2:38 am

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.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 36 guests