Am 07.01.2021 um 22:16 schrieb Burak Korkusuz:
I just randomly wrote my code as an example for that dataset to be
clear. Yes, I want to have a rolling initial sample with a constant.
Hm, still don't really understand what a rolling initial sample is; I'm
asking because gretl's builtin --recursive option might be relevant. But
anyway, just define your horizon, e.g.:
horizon = 5
and replace your fcast lines with the adapted ones:
fcast 5+i+horizon 5+i+horizon
frcst[5+i+horizon] = $fcast
Notice, however, that in a model of your type (ols LRM const LRY), the
RHS variable LRY is treated as exogenous. So your "forecast" in this
case does nothing else than take the observed value of LRY five steps
ahead and plugs it into the estimated equation. But that comes from your
model specification, not from the fcast command.
hth,
sven