An algorithm for optimizing multiple variables is more efficient than a trial error

The Google results for this reading require more complex mathematical calculations than I know (and I may not be smarter than fifth grade, but I'm not going to figure it out).

I am looking for a general way to solve multidimensional optimization problems, preferably in C #, without having to delve into matrices and eigenvectors and normal distributions.

Say I have numerical variables x , y , z and w , and the function f is such that w = f(x, y, z). I want to maximize w and ...

  • f is unknown
  • Independence from x, yand / or z, if any, is unknown
  • In some cases, I only have post-hoc data sets
  • In other cases, I vary x, yand zand re-change the won-demand
  • In cases priori ideal algorithm maximizes wthe lowest tentative permutations x, yand zand selects the next value for each sample after each round

I have approximate minimum and maximum estimates for independent variables. Of course, I don’t want to choose a permutation space more than necessary. I would like to have at least an algorithm a rough ability to detect the most flagrant of addiction, such as reducing the impact at x> 2yor actual deterioration w, when the amount x, yand zexceeds a certain ceiling, etc.

, , , , nergenflip Boigenfoodle Continuum, . ?

+3
3

, .

, x, y, z. dx, dy dz ( ). w (x + dx, y + dy, z + dz) > w (x, y, z), . w (x + dx, y + dy, z + dz)/w (x, y, z).

Python

def simAnneal( w, seed_x, numSteps=100000, sigma=0.01 ):
    optimal_x = [i for i in seed_x]
    optimal_w = w(optimal_x)

    cur_w = w(seed_x)

    for i in range(numSteps):
        new_x = [i+random.gauss(0, sigma) for i in seed_x]
        new_w = w(new_x)

        if (new_w > cur_w) or (random.random() > new_w / cur_w) :
            cur_x = new_x
            cur_w = new_w
            if cur_w > optimal_w:
                optimal_w = cur_w
                optimal_x = cur_x
    return optimal_x
+3

, Nelder-Mead Simplex # http://www.dotnumerics.com/NumericalLibraries/Optimization/Default.aspx. , , -, , . , , , , Torchon Simplex, , Torchon Simplex #.

+3

f, . (x, y, z). f (x, y, z) (x + delta, y, z). , . , . . f, .

Note that this will give you a local maximum, not necessarily global. It is also very numerically unstable if your delta is too small.

You can do much better if you know something about f, for example, if it is a polynomial with a low degree in x, y, z. Then you can perform the least-squares subset of the coefficients and then maximize the polynomial by setting the derivatives to zero.

+2
source

All Articles