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