Am 18.05.20 um 21:40 schrieb Burak Korkusuz:
Yes, HARWEEK and HARMONTH variables refer to the past and they are
already averaged weekly/monthly values. The thing is as a series I
cannot pick up one-step-ahead forecasted values that is generated by
re-estimated regressions. When I run, the codes generate a series has
only 436th forecasted observation.
The below codes give output as I would like to do (one-step-ahead
rolling windows forecasting) but I cannot save a series those
one-step-ahead forecasted values.
<hansl>
set verbose off
loop i=1..100 -q
smpl 23+i 335+i
ols RV5_FTSE const RV5_FTSE(-1) HARWEEK HARMONTH
fcast 336+i 336+i
endloop
</hansl>
Well you can always use the $fcast accessor to get the result of the
last fcast command. So before the loop create a variable to be filled,
e.g. like this:
series pointforecast = NA
And then directly after the fcast line but still inside the loop you
insert something like:
pointforecast[336 + i] = $fcast
This should give you the wanted series of 1-step-ahead rolling forecasts.
cheers
sven