Hi,
I'm wondering if there's a way to program an equation so that its estimation uses all data up to point of the next forecast. For example, right now I have one part of the sample (sample1) used to estimate the equation and the rest of the sample (sample2) to create the forecast. As here:
smpl sample1
equation eq1.ls y c x
smpl sample2
eq1.fit y_f
What I'd like to do is have the sample1 not be a fixed set of dates but all the data up to the point of the forecast, so it moves.
Any ideas?
Much appreciated and thanks in advance.
Moving sample
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Moving sample
It is called a rolling regression or forecast and there are tons of examples on the forum
Re: Moving sample
Does anyone know what is wrong in a sample time for this program.:
scalar start= @dtoo("12/31/2012")
scalar end= @dtoo("12/31/2013")
equation eq1
!step=1
for !i =start to end step !step
%date = @otod(!i-1)
scalar element = @elem(h_window, %date)
'reg. equation
smpl (!i-element) (!i)
eq1.ls mah01 c mah01(-1) mah01(-7)
' make forecasts
smpl !i !i
eq2.forecast(f=na) tmp_yhat tmp_se'
mahh01f= tmp_yhat
mahh01f_se = tmp_se
next
The algorithm has to be good, because is taken from some other program language. But I'm not so good program user in eviews.
scalar start= @dtoo("12/31/2012")
scalar end= @dtoo("12/31/2013")
equation eq1
!step=1
for !i =start to end step !step
%date = @otod(!i-1)
scalar element = @elem(h_window, %date)
'reg. equation
smpl (!i-element) (!i)
eq1.ls mah01 c mah01(-1) mah01(-7)
' make forecasts
smpl !i !i
eq2.forecast(f=na) tmp_yhat tmp_se'
mahh01f= tmp_yhat
mahh01f_se = tmp_se
next
The algorithm has to be good, because is taken from some other program language. But I'm not so good program user in eviews.
- Attachments
-
- worfile_mah.wf1
- (51.26 KiB) Downloaded 289 times
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Moving sample
You're trying to set the sample with integers, but your file is dated, so you need to set the sample with dates. You can use the @otod function to convert from an integer observation number into a date.
Who is online
Users browsing this forum: No registered users and 2 guests
