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

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

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

arnaud Mosnier-2
Dear UseRs,

Is there a way to define the lower-upper bounds for parameters fitted by
optim using the Nelder-Mead method ?

Thanks,

Arnaud

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

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

Thomas Lumley-2
On Wed, May 2, 2012 at 7:58 AM, Arnaud Mosnier <[hidden email]> wrote:
> Dear UseRs,
>
> Is there a way to define the lower-upper bounds for parameters fitted by
> optim using the Nelder-Mead method ?
>

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

--
Thomas Lumley
Professor of Biostatistics
University of Auckland

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

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

Ted Harding
In reply to this post by arnaud Mosnier-2
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.

Hoping this helps,
Ted.

-------------------------------------------------
E-Mail: (Ted Harding) <[hidden email]>
Date: 01-May-2012  Time: 22:39:15
This message was sent by XFMail

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

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

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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

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

Hans W Borchers
Ben Bolker <bbolker <at> gmail.com> writes:

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

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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

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

arnaud Mosnier-2
In reply to this post by Ted Harding
Thanks for this good idea !

Arnaud

2012/5/1 Ted Harding <[hidden email]>

> 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.
>
> Hoping this helps,
> Ted.
>
> -------------------------------------------------
> E-Mail: (Ted Harding) <[hidden email]>
> Date: 01-May-2012  Time: 22:39:15
> This message was sent by XFMail
> -------------------------------------------------
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.