Re: [R] Optim() violates constraints

From: Ben Bolker <bolker_at_ufl.edu>
Date: Fri, 20 Jun 2008 13:18:26 +0000 (UTC)

Zornitsa Luleva <zornitsa.luleva <at> gmail.com> writes:

>
> Hi,
>
> I am using the mle2 method of the package 'bbmle'. The method is calling as
> far as I understood it the optim method "L-BFGS-B" (this is the method I
> use). The latter one allows the user to impose box constraints on the
> variables, i.e. to give lower and upper bounds. It is important that the
> initial values satisfy the constraints. In my problem, it is the case. I do
> not know if there is something else to watch for, but the algorithm violates
> the constraints that I have given and therefore, my algorithm is not
> working. Do you have any idea what I can do about it?
>
> Thank you very much in advance!
>
> Zoe

  Well, bbmle is my package so technically you should be writing to me (bolker at ufl.edu) and not the list about it, but ... it's actually an optim() issue. Various people have hit this kind of problem in rare circumstances.

http://bugs.r-project.org/cgi-bin/R/Analyses?id=3325;user=guest
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/13004.html
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/124619.html
http://finzi.psych.upenn.edu/R/Rhelp01/archive/15859.html

  The usual advice is (1) to use the parscale option within the control argument to make sure the problem is scaled properly (this will usually fix most L-BFGS-B problems), (2) if necessary set the bounds just a little bit inside the true constraints.

  If this doesn't fix the problem, please post (as suggested in the posting guide) a minimal, self-contained, reproducible example ...

   Ben Bolker



R-help_at_r-project.org 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. Received on Fri 20 Jun 2008 - 15:53:58 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 20 Jun 2008 - 16:30:46 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive