On Tue, 19 Mar 2019, Sven Schreiber wrote:
function series obsweek(void)
if $pd != 52
funcerr "Not a weekly dataset"
list s = seasonals() # gives S1...S52
series obsweek = NA
loop i=1..$pd -q
obsweek = (S$i == 1) ? i : obsweek
setinfo obsweek --description="Week indicator"
setinfo obsweek --discrete # doesn't work !?
In general there can be two sorts of weekly data in gretl: one
that's just weeks 1 to N without any calendar dates attached, and
another that is indexed by an actual date for the start of each
Question: now that we have the isoweek() function we could redefine
seasonals() to use ISO 8601 week numbers in the second case rather
than just repeating 1 to 52 without regard to the calendar -- would
that be worthwhile?
(If the answer is No, that's fine by me!)