Thanks for your reply,maybe, that one is clearer. This is for one-step ahead forecasting.
I am trying to generate 5 (and 22) -step-ahead out-of-sample forecasts using the equation
(ols djclose const djclose(-1)) starting of the sample period 1+i – 100+i. However, the
equation is estimated recursively every time and forecasted every time using the new
equation fitted values.
open djclose.gdtset verbose offseries frcst = NAloop i=1..200 -q #out-of-sample
(10 observations)# smpl 1+i 100+i #initial sample (5 observations)# ols
djclose const djclose(-1) fcast 101+i 101+i
#one-step-ahead-rolling-windows-forecasting# frcst[101 + i] = $fcastendloop
On Thursday, January 7, 2021, 09:35:14 PM GMT, Sven Schreiber <svetosch(a)gmx.net>
wrote:
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
_______________________________________________
Gretl-users mailing list -- gretl-users(a)gretlml.univpm.it
To unsubscribe send an email to gretl-users-leave(a)gretlml.univpm.it
Website:
https://gretlml.univpm.it/postorius/lists/gretl-users.gretlml.univpm.it/