Page 1 of 1

two stage least square ARMA in rolling window

Posted: Tue Feb 02, 2010 4:15 pm
by dakini
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!

Re: two stage least square ARMA in rolling window

Posted: Tue Feb 02, 2010 6:12 pm
by EViews Gareth
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

Posted: Wed Feb 03, 2010 3:51 am
by dakini
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?

Re: two stage least square ARMA in rolling window

Posted: Wed Feb 03, 2010 9:05 am
by EViews Gareth

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

Posted: Thu Feb 04, 2010 5:37 am
by dakini
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

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
yhat1 is suppose to be a series data of forcasted value, but now I just get 'NA'

Re: two stage least square ARMA in rolling window

Posted: Thu Feb 04, 2010 7:35 am
by dakini
Hi, Gareth, I've sorted it out! thanx!

awesome website, really like it :D