greetings everyone!
i am trying to do a rolling window static forecast out of a simple ECM model but i cannot manage to obtain the complete forecast: that is when i look in the forecast output (wtifore) i only get the results for the last iteration of the loop. here's the code
scalar obs=5490
scalar window= 500
for !i = window to obs-window
smpl !i-window+1 !i
equation prova_ecm
prova_ecm.ls d(wti) c d(wti_f3) u(-1)
smpl !i+1 !i+window
prova_ecm.fit wtifore
next
smpl @all
i know i should create something to contain the forecasted values after each iteration to avoid overwriting them, but i just can't figure out how. can anyone help me?
tx in advance [edit: i'll attach also the wf]
rolling window help
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
rolling window help
- Attachments
-
- ecm.WF1
- (186.07 KiB) Downloaded 461 times
Re: rolling window help
Try this way:
Code: Select all
scalar obs=5490
scalar window= 500
matrix(window,obs-2*window+1) results
for !i = window to obs-window
smpl !i-window+1 !i
equation prova_ecm
prova_ecm.ls d(wti) c d(wti_f3) u(-1)
sample s !i+1 !i+window
prova_ecm.fit wtifore
stom(wtifore,rvector,s)
colplace(results,rvector,!i-window+1)
delete s rvector
next
smpl @allWho is online
Users browsing this forum: No registered users and 2 guests
