How to automatically find proper initial values for fmincon?

2.5k views Asked by At

I am trying to minimize a target function with nonlinear constrains. My problem is to conveniently find a proper initial value set for the parameters. Because the initial values must satisfy the nonlinear constrains, too, however, in my objective function, I have more than 1000 data points, resulting in 1000 function values. As a consequence, the initial values I chose usually cannot make my target function get meaningful value at every data point, namely, my objective function gets NaN at some data point, which stops the minimization procedure...

I am curious is there any good way for me to search a proper initial value automatically? (Because I have a bunch of functions to minimize...) Any thoughts and suggestions would be helpful!

For example, my objective function is a function handle like:

      myFUN = @(a,b,theta,u1,u2)function_handle.

the u1 and u2 here need to be put into data.

what I did is like this:

    [para,fval,exitflag1] = fmincon(@(para)myFUN(para(1),para(2),para(3),u1,u2),para_initial,[],[],[],[],lb,ub,@ucon,options1);

my problem is that my initial values sometimes get NaN for certain points of u1/u2 for myFUN.

Now what I am trying to do is to use some other constrains to get meaningful initial values. For example I have an integral function like this:

    conFUN1 = integral(integral(conFUN2,u1,0...1),u2, 0...1) = constant.

I would like to use this constrain to guess some initial values. However, I don't know how to numerically get the integral value with unknown parameters a, b, and theta.

What I'm doing with the integral is like this:

     inner = @(a,b,th,u2)quadgk(@(u1)conFUN2(a,b,th,u1,u2),0.0001,0.9999)

     DBintegral = @(a,b,th)quadgk(@(u2)arrayfun(inner(a,b,th,u2)), 0.0001,0.9999)

and I want to get values for

     DBintegral(1,1,3), 

something like that...

I am not sure whether I explained my problem clearly...

1

There are 1 answers

0
vbar On

I am not sure if using gradient based method at first place is good solution in Your case. You should use some heuristic methods like Monte-Carlo, pattern search or evolutionary algorithms. Or the best solution in my opinion would be a mix of gradient based local method with Monte Carlo:

First You try random values of Your design variables: a,b,theta,u1,u2 and You check if the answer is inside Your constrains. If it is You run local gradient method from this starting point and You save results as minimum. Than You try again with random values of design variables and again if answer will be inside constrains You run gradient method and check if the new point is better or worse. And so on until in some time there will be no better value of local minimum.