Re: Plot vs NMaximize
- To: mathgroup at smc.vnet.net
- Subject: [mg94373] Re: Plot vs NMaximize
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Thu, 11 Dec 2008 03:46:43 -0500 (EST)
On 12/10/08 at 4:47 AM, Nikolaus at rath.org (Nikolaus Rath) wrote:
>Bill Rowe <readnews at sbcglobal.net> writes:
>>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.
Quite simply with existing technology there is no practical way
to do this. In essence, you are asking for an automated
algorithm for finding a global maximum. That is a very tough problem.
You can somewhat approximate what plot does with NMaximize by
choosing a different method for the maximization. The methods
RandomSearch, DifferentialEvolution and SimulatedAnnealing all
generate random samples in your coordinate space then process
those sample points to find a maximum or minimum. You can get
more details on these methods in the tutorial
tutorial/ConstrainedOptimizationOverview
Also, note the process of using Plot to find a maximum isn't
without issues as well.
Consider the following:
Plot[x + Abs[x - 1]^-.005, {x, 0, 2}]
There is an obvious singularity at x = 1 that doesn't show on
the plot. The problem is unless this function is sampled very
close to x = 1, there is no way to detect the singularity.