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

조회 수: 8 (최근 30일)
Shuai Nie
Shuai Nie 2020년 7월 6일
댓글: Alan Weiss 2020년 7월 7일
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');
tic;
[xms,~,~,~,solsms] = run(ms,problem,10);
toc
Thank you so much!!!!

답변 (2개)

Matt J
Matt J 2020년 7월 6일
편집: Matt J 2020년 7월 6일
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
Shuai Nie
Shuai Nie 2020년 7월 7일
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!

댓글을 달려면 로그인하십시오.


Alan Weiss
Alan Weiss 2020년 7월 6일
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
  댓글 수: 2
Shuai Nie
Shuai Nie 2020년 7월 7일
편집: Shuai Nie 2020년 7월 7일
Hi Alan,
Thanks for your reply.
I have tired to normalise my parameters, but it still shows the same results.
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.
I tried to use MultiStart ('UseParallel', 'false'), it works!!! But it is very time consuming, so I want to use 'parallel multiStart' ! Do you have any idea why solver do not work when I enable 'UseParallel'?
Thanks in advance!
Alan Weiss
Alan Weiss 2020년 7월 7일
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

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Global or Multiple Starting Point Search에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by