On Mon, 20 May 2019, Allin Cottrell wrote:
On Mon, 20 May 2019, Riccardo (Jack) Lucchetti wrote:
> Sorry for the bombardment: I just realised that, much to my surprise, not only
> we don't have a numerical root-finding function in hansl; it seems we don't
> have one in libgretl either!
>
> So I put together a quick hansl prototype for the crudest algorithm there is
> (the bisection method). It's reportd below, with a few examples. The question
> is very much similar to the one in the other thread: shall we put this into
> extra.gfn, or add this (hopefully, in a refined form) to libgretl and
> eventually expose a user-level function?
The prototype seems to work very nicely. I've added a C translation as
a hansl built-in under the name fzero (might as well use the matlab
name, I guess). Not yet documented.
Wow, very nice, thanks!
I was thinking that perhaps we may want to change the signature of the
function a little to make it more flexible: how about modelling it after
GSSmax (with the obvious adjustments)? That way, one could easily solve
for a function with parameters.
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------