Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maximizing a function by minimizing its inverse

Let's say I have a function f(x) defined over a given range [a,b] for which f(x) > 0. I want to maximize f, but my algorithm can only minimize a given function.

Given the premises, is there any difference in minimizing -f(x) or 1/f(x) ? To me, given that f(x) is always positive, there is no difference at all, as the global maximum becomes the global minimum of [a,b] in either cases. Precision : I use a standard genetic algorithm for the process. My principal concern lies in how it explores the space depending on the function used, but so far, there seem to be no difference at all.

like image 561
TimK Avatar asked Jul 06 '26 07:07

TimK


1 Answers

As mentioned in the comments, you could run into numerical issues. For example, if f(x) in range [a,b] takes up large values you could end up with rounding errors if you use 1/f(x) as opposed to -f(x). I would stick with minimizing -f(x).

like image 156
gomfy Avatar answered Jul 11 '26 08:07

gomfy