This is by way of response to Dimitris Brilakis, who reported recently
that when he saved nonlinear least squares models into a gretl session
file, these models could not be rebuilt when the session file was
reopened.
This is now fixed in gretl's git repository and the current snapshots
at sourceforge. Fixed, that is, in the sense that current gretl will
not produce session files that have this problem. Unfortunately, this
does not mean that gretl will now successfully read "old" session
files that have the problem in question. However, such session files
can be fixed, and if anyone has a bad session file that is valuable to
them, send it to me and I can fix it. I'm adding an account of the
details below in case anyone is interested.
A gretl session file is a zipped collection of XML files. When writing
strings into an XML file one has to be careful with strings that might
contain the bytes '<' or '>' since these are special in XML,
indicating the start or end of a "tag". These bytes have to be
"escaped", substituting "<" for '<' and
">" for '>'. We've been
doing that in most cases, but we missed the "depvar" element in a
gretl model. For most models, "depvar" is just the name of a series
(the dependent variable) and that can never contain XML-special
characters. But in the case of NLS the "depvar" string is the formula
that specifies the nonlinear regression function, and that may contain
problematic characters. So now we ensure that the depvar string is
properly escaped, if needed, when saving a session file.
How to fix an old session file? You have to unzip the .gretl file,
find the model files, open them in a text editor, and within the
"depvar" string replace any instances of '<' with
"<" and any
instances of '>' with ">". Then zip the file up again and it
should
be OK. Some gretl users may be OK with doing this themselves, but as
mentioned above I'm willing to perform the fix if needed.
Allin Cottrell