On Mon, 20 May 2019, Riccardo (Jack) Lucchetti wrote:
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.
That's a bigger job. I'll leave it undocumented for now and we can
revisit it for 2019c. Meanwhile I've fixed a bug in the simple
version: the "conv" condition could be met without finding a zero.
Allin