1

I've a mathematical function by 4 parameters input. Also there are bounds in parameters:

a = [0,2]
b = [-1,1]
c = [eps, inf]
d = [-inf, inf]

I want to minimize the final value and find best parameter in function. In Scipy there are just 3 functions to support bounding optimization problems as 'TNC', 'SLSQP' and 'L-BFGS-B' [refrence: optimizations].

The problem is when SLSQP and sometimes other methods select nan for parameters and thus, result of function goes to nan for value. It's happend suddenly, for e.g. in step i-1 run normal and return real value, but for step i input parameters is nan and so final results goes to nan. From then on, inputes and outputs is nan while maximum iterations is reached!

Where is the issue?

The summery code is here:

bnds = [(eps, 2.), (-1.,1.), (eps, np.inf), (-np.inf, np.inf)]
scipy.optimize.fmin_slsqp(myFunc, params, bounds=bnds)

or

scipy.optimize.minimize(myFunc, params, method='SLSQP', bounds=bnds)

Because of there are no real solution for this issue, I was forced to change my problem!

shozdeh
  • 172
  • 1
  • 11
  • 1
    I imagine that this can happen under certain circumstances. Without knowing the function you wish to optimize, it is probably impossible to find out what is happening. – Christoph Jan 23 '16 at 12:17
  • The function is very complex and very long. It's a probability density function for a non-closed from distribution. But this function work correctly. – shozdeh Jan 23 '16 at 12:27
  • You wish to minimize a PDF on an unbounded domain? Anyway, are you certain that the function works well for very large parameters (many kernel density estimates might not for example). – Christoph Jan 23 '16 at 12:36

0 Answers0