Skip to content
Prev 198966 / 398506 Next

1 dimensional optimization with local minima

Most methods for optimization in R seek local minima, though there are
some -- mainly for >1 dimensions, that attempt to find the global
minimum stochastically (optim method SANN, DEoptim). SANN does, I
believe, handle 1 dimension, but does not have a convergence test, but
runs a fixed number of function evaluations (I got bitten by this
unusual behaviour, as it returns a "converged" flag after the specified
number of evaluations).

While there are some techniques that can generate global minima given
conditions on the function, I would anticipate you will do better
graphing your function(s) to learn if they have just a few (++) or very
many (-- = very bad for you) optima. You should apply bounds to your
domain -- a lot of computational time is wasted when routines take a
wild excursion away from a region of interest. That may be enough. Or
you may need to segment the domain to isolate the minima then select the
best. That is, find a local minimum, choose a new interval that does not
include this and apply optimize() again. Messy, but unless you have lots
of local minima, should work OK. If you do have lots, it is likely you
need to re-pose your problem.

JN