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

Ben Bolker bbolker at gmail.com
Wed May 2 00:46:42 CEST 2012


 <Ted.Harding <at> wlandres.net> writes:

> 
> On 01-May-2012 19:58:41 Arnaud Mosnier wrote:
> > Dear UseRs,
> > 
> > Is there a way to define the lower-upper bounds for parameters
> > fitted by optim using the Nelder-Mead method ?
> > 
> > Thanks,
> > Arnaud
> 
> 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.

  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).



More information about the R-help mailing list