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. Actually in my real dataset I use the
lagged variables of my dependent variable (it is a time series regression). I can consider
only the first lag of dependent variable and constant in the equation.
On Thursday, January 7, 2021, 08:30:36 PM GMT, Sven Schreiber <svetosch(a)gmx.net>
wrote:
Am 07.01.2021 um 20:23 schrieb Burak Korkusuz:
Hi,
Below is an example for one-step ahead forecasting that I use the first
5 obs. for initial sample and then forecast one-step-ahead by rolling ahead.
My question is that how should I change my code to get 5-step-ahead
rolling forecast.
Thanks,
open denmark.gdt
set verbose off
series frcst = NA
loop i=1..20 -q #out-of-sample (20 observations)#
smpl 1+i 5+i #initial sample (5 observations)#
ols LRM const LRY
fcast 6+i 6+i #one-step-ahead-rolling-windows-forecasting#
frcst[6 + i] = $fcast
endloop
Hi, two questions first: Do you really want to have a rolling sample
with a constant sample length of 5 obs? Or rather move only the end obs?
Secondly, do you really want to have no lagged variables in your
equation? While technically feasible, a "forecast" from an equation
where all regressors except the constant are unknown for the next period
doesn't give anything really meaningful.
cheers
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/