Hello all,
As you know, gretl automatically gives sequential numbers to models
estimated in a given session. I think this is at least marginally
useful, but it seems to me the details could be improved. The
following script illustrates a couple of points that I think are
problematic:
<hansl>
function matrix ols_coeff (series y, list x)
ols y x
return $coeff
end function
# first session
open data4-10
ols 1 0 2 # "Model 1"
series u = $uhat
ols u 0 2 3 4 --quiet
printf "LM: chi^2(2) = %.1f [%.4f]\n", $trsq, pvalue(X, 2, $trsq)
ols 1 0 2 3 4 # "Model 3"
# second session
open data9-7
ols 1 0 2 # "Model 1"
list X = 2 3 4
ols_coeff(QNC, X) # "Model 2"
ols 1 0 2 3 4 # "Model 2"
</hansl>
In the "first session" the two models that are printed are numbered
1 and 3. It's true a model was estimated between those two, but I'm
inclined to say that when a model is estimated with the --quiet flag
numbering should be skipped. Then the two _visible_ models would be
numbered 1 and 2.
In the "second session" we see that within a function the numbering
of models continues from the last number in the main script, but
then gets reset on exit from the function. So we see two "Model 2"
printouts. In this case I'd suggest that numbering of models be
suspended in function calls. If a function writer wants to print a
label for a given model, the "printf" command is available.
In short, my proposal is that automatic numbering be applied only to
"visible" models in the "main" portion of a gretl script. In many
cases this will be the same as current behavior, but in more complex
cases I think it would be an improvement.
Any thoughts or objections?
Allin Cottrell