[Gretl-devel] disappearing matrices

Allin Cottrell cottrell at wfu.edu
Sat Jan 13 23:03:42 EST 2007


This is going back a few days:

Sven (Wed, 10 Jan 2007)

> I run the following command:
>
> matrix weakexo = p4g_vecm_weakexo(endo, 2, 1, 3, 0, 0, \
> rexo, 0, uexo)
>
> ...and yes, it's there:
>
> ? weakexo
> weakexo
>
>      3.1524       1.0000     0.075816
>      6.2215       1.0000     0.012621
>
> BUT when I run the script with the function definition
> p4g_vecm_weakexo again (and nothing else!), the previous
> output disappears:
>
> ? weakexo
> command 'weakexo' not recognized

Me (also 10 Jan):

> The action of running a script clears out gretl's workspace. I 
> suspect it might be non-trivial to change that behaviour, though 
> this is something to think about.

I don't know what I was smoking when I wrote that, but the first 
statement is rubbish.  Simply running a script does _not_ clean 
out gretl's workspace, as is easily confirmed by example.

allin at myrtle:~/src/build/cli$ cat testrun.inp
open data4-1
matrix M = I(3)
run r1.inp
print M
allin at myrtle:~/src/build/cli$ cat r1.inp
ols 1 0 2 3 4
run r2.inp
allin at myrtle:~/src/build/cli$ cat r2.inp
omit 3 4

allin at myrtle:~/src/build/cli$ ./gretlcli -b testrun.inp
[ output as expected, culminating in printing of matrix M
   after running the scripts r1.inp and r2.inp. ]

The same thing works in the gui program.

On the other hand, opening a new data file _does_ clear out 
gretl's workspace.  So: Sven, if this is still of interest, could 
you put your question again, with a little more detail?

Allin.



More information about the Gretl-devel mailing list