Different solutions of fmincon when changing x0
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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)
0 Commenti
Risposta accettata
Torsten
il 31 Mar 2022
Modificato: Torsten
il 31 Mar 2022
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 Commenti
Shaily_T
il 26 Apr 2022
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
il 26 Apr 2022
Modificato: Matt J
il 26 Apr 2022
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.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Genomics and Next Generation Sequencing in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!