fminsearch finds local minimum when fminunc does not?
34 views (last 30 days)
Show older comments
Hi everyone,
I know the difference between fminsearch and fminunc has been discussed many times, but I am facing the following problem (minimization of an error function through 1 or 2 variables) : for my problem, fminsearch finds a local minimum while fminunc does not at all (stopping with initial guess...). Of course, I compared the two behaviors by just replacing the optim function names, with exactly the same starting guess and no additional options... I would be happy with fminsearch, but then I need to be able to define constraints and then use fmincon, so if at first fminunc does not work...
I tried it on Matlab 2008 and Matlab 2013... Same behavior!
Any idea?
Thanks,
Pascal
0 Comments
Accepted Answer
Alan Weiss
on 16 Oct 2013
Edited: Alan Weiss
on 16 Oct 2013
Perhaps you are minimizing a simulation or differential equation. This section of the documentation explains why fminunc can have trouble with this kind of minimization, and gives some suggestions. In particular, you might need to take bigger finite difference steps (set DiffMinChange to 1e-3 or so).
Alan Weiss
MATLAB mathematical toolbox documentation
More Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!