1

I have a model that is solved, returns a single output value and plots it. From those values, I plot a surface using x-values varying from 1-35 and y-values varying from 1-39, and have the returned values as values on the z-axis. See below.

This figure does not behave according to a defined function, it is simply a plot of output values.

I've been trying to use a random optimization algorithm that I created in an attempt to find the global maximum, but it takes a very long time and isn't always correct (when compared to a grid-search algorithm that I use as a comparison). The surface that is created has subtle changes in it, enough to create multiple troublesome local minima and maxima. I'm looking for a way to find the global maximum of this non-convex surface in a relatively quick fashion.

graph of function values

EDIT:

35-by-39 is the search area and that's as big as it gets. The values of the x and y axes are the input values of the model (probably shouldve mentioned that), so each of the z-values are associated with an x and y input coordinate. And my initial guess is usually smack dab in the middle of the search area.

The creation of this figure took about 50 minutes, because each of the 1365 z-values takes about 3 seconds to compute. I'd like to do this without having to use exhaustive enumeration (evaluating every point for a z-value). I'd like this to take around 5 minutes instead of 50.

EDIT(2):

Sorry for the confusion. The figure below is a 35-by-39 grid of z-values and is used purely for reference. In the actual executing of the program, all I have is the x- and y-coordinates, and I am trying to find the global maximum z-value in the fewest function evaluations possible in order to save time. So horchler, in reference to your comment, the latter.

EDIT(3):

The thing with this figure is its only a single example. There are multiple different figures that are formed when I use data from a separate source (i.e. the left side might be uninteresting in this example, but for a separate set of data, it may or may not contain the global max). And this adds to the complexity. It is impossible to tell from the data where the location of the global max will be. Some surfaces are incredibly smooth, others have large and frequent peaks throughout.

Saucy McBeef
  • 47
  • 1
  • 8
  • How about iterating over the *x* and *y* axes? There is no other way to find **the** global maximum, since it can be everywhere... **or** you know some rules about the output values and you can shrink the search area... – Kyle_the_hacker Aug 05 '13 at 17:44
  • Do you really only have 35-by-39 z values to search across? `max(z(:))`? Or is the space bigger? Are you interpolating? Or is the idea to not calculate all 35-by-39 z values and use optimization to find the global maximum with fewer points? – horchler Aug 05 '13 at 17:44
  • Maybe I am underestimating the problem, but wouldn't the [`max` function](http://www.mathworks.com/help/matlab/ref/max.html) applied to the `z`-values be able to return the index of the max value which could in turn be applied to the `x` and `y` coordinates? – Schorsch Aug 05 '13 at 17:47
  • You need to better define the question. Is your function the entire set of 35-by-39 set of z points calculated previously? Or are you performing an optimization across a 35-by-39 space and trying to find the global maximum in this space by calculating the z values at just some of the 35-by-39 points? Is the difference clear? – horchler Aug 05 '13 at 17:58
  • 2
    If you have the [Global Optimization Toolbox](http://www.mathworks.com/products/global-optimization/index.html), you might try the [global search solver](http://www.mathworks.com/help/gads/globalsearchclass.html) or the [simulated annealing solver](http://www.mathworks.com/help/gads/simulated-annealing.html). Some nice examples of the latter [here](http://www.mathworks.com/discovery/simulated-annealing.html). You could easily write your own [simulated annealing algorithm](http://en.wikipedia.org/wiki/Simulated_annealing) and I'm sure that they are available on the File Exchange. – horchler Aug 05 '13 at 18:10
  • Can you tell anything about the smoothness of your function? If the one you plotted is typical, you could easily see from just a handful of evaluations on a coarse grid that the whole left side is not interesting, and then brute-force the remaining quarter of the space or so. And 35x39 seems not a lot of points, can you not speed up the calculations (e.g. by precomputing parts that are common along a row or column) and simply brute force the whole grid? – Bas Swinckels Aug 05 '13 at 18:57
  • Monte Carlo? Basically it's a similar idea to the grid approach, but without any structure in the sampled points – Luis Mendo Aug 05 '13 at 19:00

0 Answers0