MATLAB Answers

Why does Multistart give a output same as the initial guess value?

6 views (last 30 days)
Shuai Nie
Shuai Nie on 6 Jul 2020
Commented: Alan Weiss on 7 Jul 2020
I am trying to find use MultisStart to optimise a function 'optimization_func' I created. I want to find the corresponding parameters [ X(1) to x(5) ] when 'optimization_func' reach the global minimum.
When I run the code (see below), the output parameters (xms) is exactly the same as the initial guess value (X0) I put in. There is no error message. The iterative display is shown in the photo below. Could you let me know the possible error I have in my code? This code works when I switch to globalsearch. I am sure the initial guess value (X0) do not give a global minimum.
Here is my code
%% Fitting Procedures Settings & Initiation %%
LB = [1.9 5e14 5e14 8e10 0.01]; % Lower bound for ... respectively
UB = [100 5e15 5e15 3e11 0.1]; % Upper bound for ... respectively
X0 = [20 1e15 1e15 1e11 0.08];
%% fitting
opts = optimoptions('fmincon', 'Algorithm', 'interior-point');
problem = createOptimProblem('fmincon','objective', ...
@(x)optimization_func(x(1), x(2), x(3), x(4), x(5)),'x0',X0,'lb',LB,'ub',UB,'options',opts);
ms = MultiStart;
ms = MultiStart(ms,'UseParallel',true,'Display','iter');
[xms,~,~,~,solsms] = run(ms,problem,10);
Thank you so much!!!!

Answers (2)

Matt J
Matt J on 6 Jul 2020
Edited: Matt J on 6 Jul 2020
I am sure the initial guess value (X0) do not give a global minimum.
What have you done to verify that? Have you tested optimization_func to see if it gives values consistent with your expectations?
Based on the "Local f(x)" output that you've displayed, the value of your optimization_func appears to be zero everywhere across a very broad region - broad enough to cover all of your search points. So of course the solver has no reason to look beyond the initial points to find an optimum.
  1 Comment
Shuai Nie
Shuai Nie on 7 Jul 2020
Hi Matt,
Thanks for your reply, I have tested my 'ptimization_func' fuction. I tried to set the initial guess value as input, and the output of 'ptimization_func' is 1e6 which is definetly not the global minimum. I tried to replaced the MultiStart by GlobalSearch, it can find a set of parameters that gives a output = 0.35. Do you have anyidea why solver do not work?
Thanks in advance!

Sign in to comment.

Alan Weiss
Alan Weiss on 6 Jul 2020
There is a good chance that things would do better if you would scale your problem. Some of your bounds are of order 1e15, some of order 1e-2. This is not good. Change your objective function to accept values of order 1 or so, and internally multiply particular values by 1e15 or whatever you need.
It is also clear from the display you show that the local solver believes that the value of the gradient is exactly zero at each point that it tried (you can see that the first-order optimality is exactly 0). Therefore the solver takes no steps at all.
Alan Weiss
MATLAB mathematical toolbox documentation
Alan Weiss
Alan Weiss on 7 Jul 2020
Oh, the problem is in parallel only? I am not an expert in the issues related to parallel computing, but there are some cautions in the documentation that might be relevant:
Alan Weiss
MATLAB mathematical toolbox documentation

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!