Help with a minimize problem
Mostra commenti meno recenti
f
unction b = two_var(v)
x = v(1);
y = v(2);
b = 242*log(1-x-y)+120*log(2*x-x^2-2*x*y)+79*log(2*y-y^2-2*x*y)+33*log(2*x*y);
end
v = [0.5,0.5]
a = fminsearch(@two_var,v);
I'm trying to minimize this function with the next code. The answer is x=0.247 and y=0.173
I leave the link where the problem comes from. Page 4
Risposta accettata
Più risposte (2)
kowshik Thopalli
il 5 Mar 2017
I dont understand.
two_var =@(x) 242*log(1-x(1)-x(2))+120*log(2*x(1)-x(1)^2-2*x(1)*x(2))+79*log(2*x(2)-x(2)^2-2*x(1)*x(2))+33*log(2*x(1)*x(2));
v = [0.5,0.5];
x = fminsearch(fun,v)
this gives me x =
0.525000000000000 0.500000000000000
You forgot to attach the link. Changing v would give a different answer. What is it that you exactly want to do?
1 Commento
Roberto López
il 5 Mar 2017
Roger Stafford
il 5 Mar 2017
0 voti
It is quite possible for functions such as yours to have more than one point of local minimum. If that is the case, the one that fminsearch will arrive at will depend on the given initial estimate. You need to try a different initial estimate if you are to arrive at the value you refer to in the MIT article.
1 Commento
Roberto López
il 5 Mar 2017
Categorie
Scopri di più su Mathematics in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
