Re: weird NMaximize behaviour
- To: mathgroup at smc.vnet.net
- Subject: [mg92067] Re: weird NMaximize behaviour
- From: appris at att.net
- Date: Fri, 19 Sep 2008 05:15:25 -0400 (EDT)
- References: <gat9qm$ejo$1@smc.vnet.net>
Try to pick a method such as DifferentialEvolution
NMaximize[{(x - 1)^2, -2 <= x <= 2 && -1 <= y <= 1}, {x, y},
Method -> "DifferentialEvolution"]
{9., {x -> -2., y -> 1.}}
I believe the default condition uses "NelderMead" and that apparently
provides the wrong result. The RandomSearch takes a while.
"SimulatedAnnealing" converges to the right answer as well.