Why is the FMINUNC function within the Optimization Toolbox 3.0 (R14) slower for some problems than it was in the Optimization Toolbox 2.3 (R13SP1)?

2 views (last 30 days)
When I use the FMINUNC function in MATLAB 7.0 (R14), it takes longer for my minimization problem than it did in MATLAB 6.5.1 (R13).

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
The FMINUNC function has a a new medium-scale algorithm in the Optimization Toolbox 3.0 (R14) than it did in previous versions. There are two reasons we have decided to implement this new method:
1. The new FMINUNC is a standard implementation of quasi-Newton, and, unlike the algorithm in version 2.3, it uses the gradient in the line search procedure. If you provide the gradient, version 3.0 is expected to be as fast (maybe faster) than in R13SP1.
However, if you do not provide the gradients, they have to be estimated via finite differences at the cost of additional function evaluations during the inner iterations of the line search procedure.
This new implementation of the method with a gradient-based line search has the advantage of being theoretically sound and guaranteed to terminate under MILS assumptions, though sometimes at the expense of requiring more evaluations to estimate the gradient.
2. Another reason why the new FMINUNC may take longer is that the stopping tests are now more stringent (again, they were changed because the old FMINUNC had some non-standard stopping tests). Check the values of "fval" and "norm(gradient, Inf)", where "fval" and "gradient" are output arguments from FMINUNC, and make sure they are about the same in both versions. If either "fval" is smaller or "norm(gradient,inf)" is closer to zero in the new version, try larger values for the "TolFun" and/or "TolX" option properties, and rerun the solver.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!