fminsearch terminates/converges for a high fval

4 Ansichten (letzte 30 Tage)
Dave
Dave am 4 Nov. 2014
Bearbeitet: Matt J am 4 Nov. 2014
Hello, I am trying to estimate the parameters of a function but the optimization terminates even though the objective function is high.
I show below two cases, the first case is OK to me, the second case is where I have the problem.
In 1) you can see that min f(x) is 6.28017e-30, the value of the objective function is low enough.
However, in case 2) optimization terminates but the value of the objective function is 0.9391 which is still very high.
How can I make the optimization continue until it meets the criteria (when "fval" is low enough) ? Thanks
options = optimset('Display', 'iter', 'MaxFunEvals', 1e8, 'MaxIter', 1e6, 'TolX', 1e-10, 'TolFun', 1e-14);
[params fval] = fminsearch(@(B) fun(B,...), inival, options);
1) OK CASE (final fval low enough)
Iteration Func-count min f(x) Procedure
0 1 0.035832
1 4 0.035832 initial simplex
2 6 0.00525569 expand
...
526 927 2.1518e-29 contract outside
527 929 6.28017e-30 contract inside
Optimization terminated:
the current x satisfies the termination criteria using OPTIONS.TolX of 1.000000e-10
and F(X) satisfies the convergence criteria using OPTIONS.TolFun of 1.000000e-14
fval =
6.2802e-30
2) BAD CASE (final fval very high)
Iteration Func-count min f(x) Procedure
0 1 0.940907
1 4 0.939127 initial simplex
2 9 0.939127 shrink
...
48 239 0.939127 shrink
49 241 0.939127 contract outside
Optimization terminated:
the current x satisfies the termination criteria using OPTIONS.TolX of 1.000000e-10
and F(X) satisfies the convergence criteria using OPTIONS.TolFun of 1.000000e-14
fval =
0.9391

Antworten (1)

Matt J
Matt J am 4 Nov. 2014
Bearbeitet: Matt J am 4 Nov. 2014
The final value of the objective function is not a good indicator of whether the solver has succeeded. For example, you could repeat case 2 with fun() simply translated downward
[params fval] = fminsearch(@(B) fun(B,...)-0.939127, inival, options);
You will get the same solution for "params", but a much smaller value for fval.
It is possible, of course, that you simply got stuck in a local minimum. If that's what happened, making the solver continue iterating will not help. You need a better initial guess, inival.

Kategorien

Mehr zu Solver-Based Optimization Problem Setup finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by