On Sun, Oct 2, 2022 at 9:20 PM Federico Fiorani <deferoci(a)gmail.com> wrote:
Dear all,
in my opinion a brief description in the manual of how series, bundles
and restrictions work might be helpful.
As example:
<hansl>
nulldata 10
s = index % 2 ? NA : 1
bundle b = null
smpl 1 5
b.s1 = s
smpl full
smpl --no-missing
b.s2 = s
smpl full
print b
</hansl>
<output>
bundle b:
s1 (series: length 10)
s2 (series: length 5)
</output>
I suppose that the series "s1" has 10 element for "preserving
information", because in "smpl 1 5" you could use only a part of
"s",
but you cannot do that with "--no-missing" because the series after
sampling is completely different.
Anyway, it isn't obvious at first sight why series s1 and s2 have
different length.
Federico, I think you have explained it quite well. After "smpl 1 5"
we still have a dataset of length 10, but (in effect) with a marker
saying that only observations 1 to 5 are currently accessible. So, as
you say, when the series s is saved to a bundle, we store the whole
thing, to "preserve information".
With "smpl --no-missing", however, gretl creates a parallel dataset
holding just 5 (non-contiguous) observations. Saving the dataset to
file in this context would save only the 5 selected observations. What
should happen when storing the series into a bundle? I don't think
there's any definitive answer. Basically it's a matter of "Don't do
that!". Use lists or matrices rather than putting series into bundles,
if the sample is going to change between accesses to the bundle (other
than just by changing the starting or ending observation).
Allin