MATLAB: How to impliment Genetic Algorithms without Boundaries

genetic algorithms

I am using Genetic Algorithms tool box of Matlab to optimize a objective function which doesn't have any boundaries. How can I achieve this?

Best Answer

I don't think you can do so if there are absolutely no limits, mainly for the same reason that you cannot generate a random uniform number, without any limits imposed. There are probably other reasons, but this is the one that sticks out to me.
GA needs first to generate a random sample for the initial population. This is done to sample as uniformly as possible from the set of all sets of parameters. So if you do not give GA bounds, then the initial sampling must fail.
As well at later steps, GA needs to do things like random mutations, etc., that again rely on knowing the boundaries.
Now, COULD you do something to make GA work? A transformation could suffice, in theory. For example, tell GA that each variable must lie in the interval [-pi/2,pi/]. Then internally, transform the variables using the tangent function. This remaps the domain [pi/2,pi/2][ into the interval [-inf,inf]. The result would not be a uniform sampling of course.
The internal resampling for such a scheme would implicitly assume the samples live under a Cauchy distribution. As distributions go, Cauchy is one of the bad boys among all distributions. But it might be your best choice.
Or, you could tell GA the points live in the bounded interval [0,1] for each variable. Then internally, transform the points using an inverse normal CDF, thus using norminv. In this case, almost all of the generated points will lie inside the interval [-3,3], but in theory there would be no boundaries. In practice, you would essentially NEVER get a point that lies outside of about [-6,6] or so.