Different solutions of fmincon when changing x0

조회 수: 1 (최근 30일)
Daniela Würmseer
Daniela Würmseer 2022년 3월 31일
편집: Matt J 2022년 4월 26일
I wanted to ask if it is normal that fmincon can have different solutions with different x0?
I implement an Algoritjm by myself and use fmincon as follows:
options = optimoptions('fmincon','Display','iter','Algorithm','sqp');
x = fmincon(fun,x0,A,b,Aeq,beq,lb,ub,nonlcon,options)

채택된 답변

Torsten
Torsten 2022년 3월 31일
편집: Torsten 2022년 3월 31일
I wanted to ask if it is normal that fmincon can have different solutions with different x0?
There can be several reasons for fmincon to converge to different "solutions" dependent on the starting point. But - sure - the optimization algorithm implemented in "fmincon" tries to find local extrema. If a function has more than one or is ill-behaved, it depends on the starting point to which of the local extrema the algorithm converges.
  댓글 수: 2
Shaily_T
Shaily_T 2022년 4월 26일
Could you please elaborate more on an ill-behaved function? Is it inherent to the function or can be dependent on our codes as well? I mean for example something wrong in our code.
And is there a way to determine which of the probabilities you mentioned is the case in our function? I mean being ill-behaved or having more than one extrema.
Thank you in advance!
Matt J
Matt J 2022년 4월 26일
편집: Matt J 2022년 4월 26일
You can look at the function values at the two solutions to see if they are nearly the same. If so, then plainly you have multiple minima. Better still, given the two solutions x1 and x2,you could plot the 1D function
g(t)=fun(t*x1+(1-t)*x2) % t from -1 to 2
If the graph is very flat between t=0 and t=1 or is very bumpy, it is a likely sign that your graph has multiple local/global minima.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Genomics and Next Generation Sequencing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by