This is a follow-up to the posting by Alecos P. at
https://www.mail-archive.com/gretl-users@gretlml.univpm.it/msg17410.html
The --lbfgs option asks gretl to use the limited-memory variant,
LBFGS, of the BFGS optimizer to minimize the GMM criterion. This can
sometimes be helpful (i.e. convergence is attained when it would not
be reached otherwise), though that was not the case in Alecos's
example.
However, LBFGS (unlike regular BFGS) supports the specification of
simple constraints on the parameter estimates. This feature has not
been exposed via the "gmm" command to date -- but see the functions
BFGScmax() and BFGScmin() for means of using this functionality.
These remarks are by way of lead-in to two changes in gretl's "gmm"
that are in today's snapshots.
1) There's now an optional parameter to the --lbfgs option: you can say
--lbfgs=<matrix-name>
where <matrix-name> is the name of a bounds matrix, whose
specification can be found in the help for BFGScmax (where the "c"
indicates "constrained"). In Alecos's example there are three
parameters, all of which should be non-negative, so employing the new
option one could do
matrix bounds = {1, 0, $huge; 2, 0, $huge; 3, 0, $huge}
gmm
...
end gmm --lbfgs=bounds
2) When LBFGS (or BFGS) converges there's no guarantee that gretl is
able to produce standard errors for the GMM parameter estimates. It
can happen that the required matrix J'WJ, where J is the (numerical)
Jacobian and W is the weights matrix, is not positive definite. Up
till now, if that happens we've flagged an error, with the not very
specific message "matrix is not positive definite". Now we don't flag
an error, and we print the estimates, but with the more specific
message "J'WJ is not positive definite, std. errors not available" --
and of course standard errors, z-scores and P-values are all NA.
Allin Cottrell