Help with a minimize problem
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (2)
kowshik Thopalli
el 5 de Mzo. de 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 comentario
Roberto López
el 5 de Mzo. de 2017
Roger Stafford
el 5 de Mzo. de 2017
0 votos
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 comentario
Roberto López
el 5 de Mzo. de 2017
Categorías
Más información sobre Mathematics en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
