Re: Plot vs NMaximize
- To: mathgroup at smc.vnet.net
- Subject: [mg94317] Re: Plot vs NMaximize
- From: Nikolaus Rath <Nikolaus at rath.org>
- Date: Wed, 10 Dec 2008 04:47:54 -0500 (EST)
- References: <ghlmm5$ko7$1@smc.vnet.net>
Bill Rowe <readnews at sbcglobal.net> writes: > On 12/8/08 at 6:22 AM, Nikolaus at rath.org (Nikolaus Rath) wrote: > >>It seems to me that it is significantly faster *and* more accurate >>to determine global maxima by plotting the function and looking for >>the positions on the plot than to use NMaximize: in all the cases >>that I've encountered recently, NMaximize got stuck in local extrema >>(which was very easy to see when looking at the plot). > >>I know that global optimization is a very difficult problem, but I >>do not understand why Plot[] does not suffer from the same problem. >>If Plot[] is able to generate a plot where I can see the position of >>the global maximum in a second, why does NMaximize need several >>seconds to get stuck in some local maxima? Shouldn't it be able to >>make use of the same algorithms that Plot[] uses? > > In short, no. The algorithms in Plot say nothing whatever about > either maxima or minima. All the plot algorithm does is sample > your function and display points at each sampled position > connecting them with lines. In absolutely no case, does this say > anything about a maximum or minimum. It is only your > interpretation of the resulting graphic that assigns > maximum/minimum to the plot. The points you see as > maximum/minimum are in no way different from any other plotted > point from the perspective of the algorithms used in Plot. > > An effective way to use NMaximize, is to first Plot the function > and use that plot to specify the search range to be used with > NMaximize (at least for the 1-D problem). I fully agree. But my question is: why doesn't NMaximize do this automatically? It seems like a very sensible thing to do. Best, -Nikolaus -- =C2=BBIt is not worth an intelligent man's time to be in the majority. By definition, there are already enough people to do that.=C2=AB -J.H. Hardy PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C