On Sat, 11 Dec 2010, Sven Schreiber wrote:
Am 10.12.2010 21:25, schrieb Allin Cottrell:
> The ID number of a series in gretl is simply the 0-based position
> of that series in a two-dimensional array of double-precision
> values. If a given series is deleted, it's inevitable that
> higher-numbered series will be relocated and hence renumbered --
> unless we were to permit holes in the dataset, which would be a
> programming nightmare.
> Neither IMO, does it make any sense to keep two sets of books, one
> recording where variables actually are and another for some sort
> of cosmetic purpose; the mapping between these two would be an
> obvious source of errors, crashes and so on.
Well it's not really only cosmetic, see the issue that started this
I would count that issue as basically cosmetic. Gretl session
files are compressed and disk space is cheap, so having some
series stored in a session file that are not strictly necessary
doesn't strike me as a serious problem.
And this kind of two-book-concept is usually denominated by the
obscure name of a "database" with "keys" :-) The DBMS (database
management system) keeps track of the memory chunks to which the
immutable keys should point.
OK, you're right, this is doable. But what we have at present is a
fast and light system for referencing series, and if we went to
what you describe we'd need to add a DB-access layer to the
back-end of almost every gretl command. In addition it would be
backward-incompatible: any scripts that rely on the current
behavior of series numbering on deletion of variables wouldn't
work any more.
Also note that even at present it's rather easy to construct a
"minimal" gretl session file (i.e. with unused series deleted) via
script. Here's a simple example:
INCOME = INCOME * POP
list X = INCOME PRICE
list lX = logs(X)
delete STOCK POP WINTER SPRING SUMMER FALL
m1 <- ols l_QNC 0 lX
Run this, and save the session, and you'll have a file that
contains the saved model plus a selected subset of data9-7. All
you have to do is arrange for the unwanted series to be deleted
before you use higher-numbered series in a saved object.
(As the example illustrates, named lists are robust with respect
to deletion of series.)