Re: Opt TB - fminunc termination exitflag criteria
- From: John D'Errico <woodchips@xxxxxxxxxxxxxxxx>
- Date: Tue, 14 Feb 2006 12:03:06 GMT
In article <ef28603.2@xxxxxxxxxxxxxxxx>, "group user" <usr_grp@xxxxxxxxx> wrote:
My guess is, the cost function is continuous but not differentiable
at a finite number of locations. it should have some noise in it
since i am doing a large number of numerical operations inside my
algorithm. (Plotting the cost function against the optimization
variable is a very time-consuming process and i have 8 dimensions to
plot against.)
The not differentiable part will definitely cause
problems with the gradient.
If you had a few less dimensions, I'd recommend
fminsearch instead as less of a problem.
I expect what is happening is the finite difference
approximation for the derivative is at one of these
derivative discontinuities.
Consider this scenario in only 2 variables: form an
objective function, z(x,y), composed of two planes
that intersect along a line.
z(x,y) = x + y/2 (if x>0)
-x + y/2 (if x<0)
If you wish, you can write it as
z(x,y) = abs(x) + y/2
The global minimizer? It occurs at (x,y) = (0,-inf).
A property of a line search is that the algorithm
directs its search along a straight line, minimizing
the objective along that line. Then it chooses a new
direction to search, based on the gradient and past
searches.
This means that the line search will tend to stop
exactly along the derivative break I've created in
my function. If it does, then the forward differenced
gradient will point the method in a direction that
causes the function to increase.
So once the method stops at such a discontinuity,
it will terminate at x = 0, but at an arbitrary
finite value of y. The exitflag will be -2.
In fact, this optimization should have diverged, in
which case I would want it to fail due to exceeding
its maximum number of iterations. But instead it will
return an exit flag of -2.
From your reply i think, i can ignore the exitflag. It looks like the
solution returned by fminunc is near or at a local minimum even when
exitflag == -2.
No. I'm not at all confident that this is correct,
given my example above.
The problem is that fminunc assumes a differentiable
objective function. There is no assurance it has
converged for this class of function.
Perhaps stochastic optimizer is best for this problem,
i.e., a genetic algorithm. Take a look at the GADS
toolbox. Also look at some of the particle swarm tools
on the file exchange, though I'd class them as still
in development.
HTH,
John D'Errico
--
The best material model of a cat is another, or preferably the same, cat.
A. Rosenblueth, Philosophy of Science, 1945
Those who can't laugh at themselves leave the job to others.
Anonymous
.
- Follow-Ups:
- Re: Opt TB - fminunc termination exitflag criteria
- From: group user
- Re: Opt TB - fminunc termination exitflag criteria
- References:
- Opt TB - fminunc termination exitflag criteria
- From: group user
- Re: Opt TB - fminunc termination exitflag criteria
- From: Usr Grp
- Re: Opt TB - fminunc termination exitflag criteria
- From: John D'Errico
- Re: Opt TB - fminunc termination exitflag criteria
- From: group user
- Opt TB - fminunc termination exitflag criteria
- Prev by Date: Define an binary image from a patch
- Next by Date: 2-D image to 3-D object
- Previous by thread: Re: Opt TB - fminunc termination exitflag criteria
- Next by thread: Re: Opt TB - fminunc termination exitflag criteria
- Index(es):
Relevant Pages
|
Loading