Can anybody help with two stage least square ARMA in rolling window? I have been struggling with this for one week :(
I need to run TSLS ARMA in a six month sample, then drop the first observation and add one more, and every time i need to get a one step ahead forcasting value.
Please help!
two stage least square ARMA in rolling window
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: two stage least square ARMA in rolling window
If you do a search of the forum for "rolling", you'll see plenty of examples. I believe the programming guide in this forum also has some useful tips.
Re: two stage least square ARMA in rolling window
thanx for your patient! Gareth, I am really a novice
I get the idea of programming rolling, but Im not sure about TSLS ARMA, I suppose an instrumental variable will be needed, can I get a programming sample of TSLS ARMA somewhere?
I get the idea of programming rolling, but Im not sure about TSLS ARMA, I suppose an instrumental variable will be needed, can I get a programming sample of TSLS ARMA somewhere?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: two stage least square ARMA in rolling window
Code: Select all
equation e1.tsls y c x1 ar(1) ma(2) @ z1 z2 z3 z4
Re: two stage least square ARMA in rolling window
Hi, Gareth, thanx a lot, it is really helpful, i now can run TSLS ARMA successfully, but another problem comes up, I cannot get one step ahead forcast, could you please take a glimpse at my programme
yhat1 is suppose to be a series data of forcasted value, but now I just get 'NA'
Code: Select all
'load workfile
load ach.wf1
' set window size
!window = 120
' get size of workfile
!length = @obsrange
' declare series for final results
series yhat1 ' point estimates
series yhat1_se
' set step size
!step = 1
' move sample
for !i = 1 to !length-!window+1-!step
' get coefficient estimates using first window sample
smpl @first+!i-1 @first++!i+!window-2
equation eq1.tsls log(us_v) c ar(1) ma(1)
' set sample to forecast period
smpl @first+!i+!window-1 @first+!i+!window-2+!step
' copy coefficients to control variable
!c1 = eq1.c(1)
!ar1 = eq1.c(2)
!ma1 = eq1.c(3)
' make forecasts in temporary series first
@tmp_yhat = !c1+ !ar1*ar(1)+ !ma1*ma(1)
' store forecasts for last step
smpl @first+!i+!window-2+!step @first+!i+!window-2+!step
@yhat1 = tmp_yhat
next
Re: two stage least square ARMA in rolling window
Hi, Gareth, I've sorted it out! thanx!
awesome website, really like it :D
awesome website, really like it :D
Who is online
Users browsing this forum: No registered users and 1 guest
