Skip to content

Define lower-upper bound for parameters in Optim using Nelder-Mead method

6 messages · Thomas Lumley, (Ted Harding), Ben Bolker +2 more

#
On Wed, May 2, 2012 at 7:58 AM, Arnaud Mosnier <a.mosnier at gmail.com> wrote:
It depends a bit on whether it's plausible that the solution is on the
boundary.  If not, simply returning Inf for values outside the range
will work.

    -thomas
#
On 01-May-2012 19:58:41 Arnaud Mosnier wrote:
The Nelder-Mead method does not provide built-in capability
to set bounds on the range of paramaters. However, you can
achieve it "by hand" by re-defining the function being
minimised, so that it tests whether an out-of-range parameter
parameter value is being used.

If not out-of-range, then return the standard value of the function.
If out-of range, then return a very large value.

Nelder-Mead will very happily "bounce off" high walls of this
kind, and if the minimum of the function is at the wall will
happily converge as close to it as you please.

Hoping this helps,
Ted.

-------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at wlandres.net>
Date: 01-May-2012  Time: 22:39:15
This message was sent by XFMail
#
<Ted.Harding <at> wlandres.net> writes:
In addition to these options, there is also a derivative-free
box-constrained optimizer (bobyqa) in the 'minqa' package (and in
an optim-like wrapper via the optimx package), and
a box-constrained Nelder-Mead optimizer in the development
(r-forge) version of lme4, which is based on the NLopt optimization
library (also accessible via the nloptr package).
#
Ben Bolker <bbolker <at> gmail.com> writes:
I could add another Nelder-Mead implementation in package 'dfoptim'. It comes
in pure R and is still quite efficient, based on Kelley's well-known book code.
It exists in unconstrained and box-constraint versions.

The "optimization world" in R is by now really scattered across many different
package with sometimes 'strange' names. Some of the packages have not yet made
it from R-Forge to CRAN. Unfortunately, the Optimization task view is not of
much help anymore in this shattered world.

We will get a lot more of these questions on R-help if we do not come up with a
solution to this problem, for instance more up-to-date optimization functions
in R base, a recommened package for optimization, or e.g. an optimization guide
as a kind of global vignette.

Hans Werner