Skip to main content

Timeline for Minimization by Nelder-Mead

Current License: CC BY-SA 3.0

20 events
when toggle format what by license comment
Apr 13, 2017 at 12:55 history edited CommunityBot
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Jul 18, 2014 at 19:28 comment added Oleksandr R. Glad to hear you're making progress! I'm sorry, but I really don't think I can help with this problem. My code never produces any inf or nan values, and nor does it perform any linear algebra. So, these values and the error are being produced entirely by your own code, which I haven't seen (and this isn't the place for it anyway). At a guess I would say that, because differential evolution evaluates the objective function with random parameters, perhaps for certain values of these parameters your function is not well behaved. If so, you need to check for that before evaluating it.
Jul 18, 2014 at 0:50 comment added SAS If you could help me with this, that would be really great, your differential evolution package is indeed splendid and really helping me in many problems :-)
Jul 18, 2014 at 0:44 comment added SAS File "/anaconda/1.6.1/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 1018, in eig _assertFinite(a) File "/opt/anaconda/1.6.1/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 165, in _assertFinite raise LinAlgError("Array must not contain infs or NaNs") numpy.linalg.linalg.LinAlgError: Array must not contain infs or NaNs
Jul 18, 2014 at 0:43 comment added SAS Traceback (most recent call last): File "test.txt", line 182, in <module> >>>output_function=None File "/home/differential_evolution.py", line 259, in minimize >>>fitness_monitor=update_cm, >>>generation_monitor=output_function File "/home/differential_evolution.py", line 115, in select >>>map(objective_function, trial_population) File "test.txt", line 137, in function >>>eigenvalues_of_M, eigenvectors_of_M = numpy.linalg.eig(M);
Jul 18, 2014 at 0:31 comment added SAS @ Oleksandr R, As for example, I have a python file, named test.txt. I am using/importing the Differential Evolution package inside the test.txt file for minimization. I get errors like : numpy.linalg.linalg.LinAlgError: Array must not contain infs or NaNs and immediately terminates the loop. The detail of the error is in the following comment.
Jul 18, 2014 at 0:30 comment added SAS @ Oleksandr R, sometimes during computation using the Differential Evolution package, for the actual minimization (lets say in a loop of 100 repetition) it finds NAN and terminates the further computation (where as I want all 100 times repetitions/minimizations). The problem is may be to do with Numpy/Scipy packages. It happens sometimes and not for all kind of problems in hand. Is there a way that, when it finds NAN it does not terminate computation and completes the full loop/repetitions ignoring the times it gets NAN ?
Jul 12, 2014 at 17:43 comment added Oleksandr R. @SAS One way to deal with simple bounds as constraints is to treat the boundaries as reflective, i.e. if the value lies outside of this range then it is pushed back inside according to the amount of constraint violation. This can be appropriate for some problems and inappropriate for others; you might prefer e.g. to randomly reassign values that violate constraints. Everything in global optimization is so dependent on the problem, that I'm not sure there is any general advice on this topic.
Jul 12, 2014 at 17:38 comment added Oleksandr R. @SAS yes, it's possible. But you have to build your constraints into the objective function somehow. A simple way to do it is to return a function value of infinity if the constraints are violated--but this excludes large parts of the complete search space and may not be appropriate for soft constraints. What you seek to do is not easy in a general and abstract sense, which is why I didn't address it in the algorithm itself. But for a specific problem, modifying the objective function is normally not too difficult.
Jul 12, 2014 at 16:45 comment added SAS @ Oleksandr R., in this example of minimization, all the parameters are free to take any value ( x= [-Infinity,+infinity] ) to optimize the function. but is it possible to use this differential evolution method to optimize a function when the parameters are restricted to in certain interval (lets say x= [x_min,x_max] ) ?
Jul 26, 2013 at 14:40 comment added Oleksandr R. @Taarchira since I can't really teach you how to write Python in comments, it's probably best if you figure this one out for yourself. I'm sure there are good books on Python out there if you want to learn it. Anyway, please be careful with this approach because the convergence tolerances I used aren't necessarily tight enough to distinguish one minimum as better than another in the $10^{-20}$ range. It may be better to come back into Mathematica and use FindMinimum at high precision to do this sort of thing, using the Python results as initial guesses.
Jul 24, 2013 at 0:01 comment added SAS when I run the actual minimization (function.py) each time it calculates for single time. But if I want to compute it let say for 1000 times {which I tried by defining a function like repeat(),but could not figure it out} could you tell me what would be the modification? The reason to do is,so that I can plot a graph min_of_function vs number_of_repetitions which will give me better understanding about the best possible local minimum. A sample of how I tried: def repeat(function,n): for i in range(n): function() def f(): (what we have.........) repeat(function,1000)
Jul 10, 2013 at 16:30 comment added Oleksandr R. @Taarchira not as far as I know. Your function just happens to be simple enough (not using any high-level functions) that one can easily write it directly in Python. I used Experimental`OptimizeExpression to do the common subexpression elimination and then just changed a few of the operators from Mathematica to Python (e.g. parentheses are used in place of brackets, ^ becomes **, I becomes 1j, and so on).
Jul 10, 2013 at 14:18 comment added SAS Instead of using "Pythonika", is there any other easier way to translate Mathematica code/function to Python (2.6 or 2.7) ?
Jul 6, 2013 at 20:55 comment added SAS ,Thank you for the update.
Jul 2, 2013 at 23:41 comment added Oleksandr R. @Taarchira please see the updated answer including the links to the Python code, which you are free to use as you see fit. Sorry for the delay in finishing the job.
Jul 2, 2013 at 23:40 history edited Oleksandr R. CC BY-SA 3.0
added 3312 characters in body
Jun 30, 2013 at 14:47 vote accept SAS
Jun 30, 2013 at 14:46 comment added SAS ,Wow!Differential evolution seems far better to minimize the particular function in hand.And it is a good finding that the problem is too sensitive to the number of significant digits,so I have to be really careful about it! I appreciate your help,Thanks :)
Jun 30, 2013 at 2:50 history answered Oleksandr R. CC BY-SA 3.0