octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exit codes for fzero


From: Rik
Subject: Re: Exit codes for fzero
Date: Mon, 15 Feb 2010 10:49:11 -0800

> 
> It's wrong here. So it's not like there is something magical, probably
> just a test like you proposed above.
> But I'm not against it; if you want to, propose a patch.
> 

Jaroslav,

I took a look at the return codes from Matlab
(http://www.mathworks.com/access/helpdesk/help/techdoc/ref/fzero.html) and
the -5 indicates that the algorithm *may* have converged on a singularity.
   This is pretty much what I was looking for -- an indication that I
should look more closely at the objective function but not a guarantee that
the function is good or bad.

For a patch, I considered a simple level test, such as fval <
SOME_TOLERANCE or (fb - fa) < SOME_TOLERANCE.  These would catch one type
of singularity where the right- or left-hand limit was undefined and going
to infinity.  However, it wouldn't catch a simple jump discontinuity such
as a step function from -1 to +1.  In that case both limits would exist and
both would be well-bounded but the two limits do not converge on the same
value.   Instead, my patch looks at the numerically calculated slope
between the last two computed points of fzero.  If the slope is extremely
high this *may* indicate a discontinuity of either the infinite or bounded
sort.

A draft of the patch is attached.  If it looks good and I get no other
comments I will commit it in a few days.

Regards,
Rik

Attachment: patch.fzero
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]