Multistart apparently does not respect the supplied initial points
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Mohammad Shojaei Arani
am 13 Apr. 2023
Kommentiert: Mohammad Shojaei Arani
am 15 Apr. 2023
Hello,
I have a simple, but annoying, problem about multistart in MATLAB. Consider the following example from MATLAB description of multistart:
fun = @(x) x.^2 + 4*sin(5*x);
opts = optimoptions(@fmincon,'Algorithm','sqp');
problem = createOptimProblem('fmincon','objective',...
fun,'x0',2.5,'lb',-5,'ub',5,'options',opts);
ms = MultiStart;
[x,f] = run(ms,problem,1)
This gives me the following answer
The local solver ran once and converged with a positive local solver exit flag.
x =
-2.7713
f =
3.8366
But, I expected to roughly get x=2.159 based on the initial point x0=2.5 I supplied. I attach a figure which shows my initial point (open circle) and my expection of local minimum (red star).
Any idea?
Thanks in advance!
Babak
0 Kommentare
Akzeptierte Antwort
Alan Weiss
am 14 Apr. 2023
The only error here is your expectation that fmincon always converges to the closest local minimum. It does not.
fun = @(x) x.^2 + 4*sin(5*x);
opts = optimoptions(@fmincon,'Algorithm','sqp');
problem = createOptimProblem('fmincon','objective',...
fun,'x0',2.5,'lb',-5,'ub',5,'options',opts);
ms = MultiStart;
[x,f] = run(ms,problem,1)
% Now let's see where fmincon goes
[x2,f2] = fmincon(problem)
Understand? MultiStart works as documented. When you call it with 1 run, it takes the supplied start point and proceeds to call fmincon. The error was expecting fmincon to converge to the closest local minimum.
Alan Weiss
MATLAB mathematical toolbox documentation
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Global or Multiple Starting Point Search 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!