On Thu, 7 Jan 2021, Sven Schreiber wrote:
Am 07.01.2021 um 23:32 schrieb Burak Korkusuz:
> Yes, now it is ok, thank you very much
>
> it gives error without appending --dynamic option
Hm, I see what you mean. The way I read the fcast documentation, this
option should be automatically implied in this context.
@Allin, what are we missing?
The problem here is that "fcast t1 t2" doesn't start the forecast
machinery until t1. So when attempting a dynamic forecast according
to
fcast 100+i+h 100+i+h # with h > 1
gretl first looks for a prior forecast of y at obs 100+i+h-1, but
doesn't find one. Here's a version of the script which works
properly:
<hansl>
open djclose.gdt
set verbose off
series frcst = NA
h = 5
loop i=1..50 -q
smpl 1+i 100+i
ols djclose const djclose(-1)
fcast 100+i+1 100+i+h
frcst[100+i+h] = $fcast[h]
endloop
</hansl>
Now you might say that gretl should be clever enough to realize that
it needs to forecast the intermediate values (at least if the
--dynamic option is given), even if they will be discarded in the
output, but right now that doesn't happen.
Why did the original version "work" with the --dynamic option and
only complain about missing values if that option was not given? A
bug: with --dynamic, gretl fell back on using actual y in place of
the missing forecast lag (so in fact giving a static forecast) but
in the "auto" case that didn't happen -- which is probably the
reverse of what should occur.
Stuff needs fixing here, but note that the problem is specific to
the case where there's a temporal gap between the estimation sample
and the start of the dynamic "fcast" range.
Allin