[R-sig-ME] nlme optim control option

Douglas Bates bates at stat.wisc.edu
Tue Apr 29 14:15:17 CEST 2008


On 4/29/08, Doran, Harold <HDoran at air.org> wrote:
> I actually trust nlminb more than I trust optim. In some of the functions I have written in the MiscPsycho package (e.g., irt.ability) we get multimodal distributions for some of the item response theory models.
>
>  When I use optim for optimization, you can get very funny results with difficult to maximize distributions. nlminb, however, gave reasonable results and the maximum was always confirmed to be "correct" via a visual examination of the likelihoods.
>
>  In other words, I can plot the likelihood function and get a sense of where the max is. optim would more often than not give results that are very (very) far away from the max with multimodal distributions whereas nlminb always gave back the max that seemed consistent with the visual plot of the likelihood.
>
>  With all of this said, you should switch to lme4.

As Harold indicated, switching the optimizer used in the nlme package
from optim to nlminb was intentional.  I had seen cases of spurious
convergence for optim and found it easier to introduce the nlminb
optimizer.

Could you give more details of the cases where functions from the nlme
package using nlminb are not converging?  Are you using the lme
function or the nlme function?  Does your model have random effects
and fixed effects only or does it also use parameterized correlation
structures?

As Harold indicated, the lme4 package is now the preferred way to fit
linear or nonlinear mixed-effects models that have only fixed effects
and random effects.  If you can show us one of your calls to lme or
nlme we can tell you how to translate it to a call to lmer or nlmer.

>  > -----Original Message-----
>  > From: r-sig-mixed-models-bounces at r-project.org
>  > [mailto:r-sig-mixed-models-bounces at r-project.org] On Behalf
>  > Of Stephan Moratti
>  > Sent: Tuesday, April 29, 2008 7:05 AM
>  > To: r-sig-mixed-models at r-project.org
>  > Subject: [R-sig-ME] nlme optim control option
>  >
>  > Hello,
>  >
>  > I am using the nlme package for quite a while, but recently I
>  > have discovered the "optim" option in the lmeControl function
>  > and I have read that until the R verison 2.2.0 the
>  > optimization function is "nlminb" and before it was "optim"
>  > by default. As I am a "user" of R I am not into the
>  > optimization functions. However, I have a case now where with
>  > optim = "nlminb" the model does not converge, whereas with
>  > optim = "optim" the model converges.
>  >
>  > Can somebody explain to me in easy words what the difference
>  > is ? If nlminb does not converge, but optim does, is the
>  > result less trustable ?
>  >
>  > Thanks,
>  >
>  > Stephan
>  >
>  >
>  > --
>  > *Stephan Moratti, PhD/
>  > /**/see also: http://web.mac.com/smoratti/ /*Centro de
>  > Tecnología Biomédica CBT, Universidad Politécnica de Madrid,
>  >
>  > en la actualidad (currently at) en el
>  > Centro de Magnetoencefalografía Dr. Perez Modrego,
>  > Universidad Complutense de Madrid, Faculdad de Medicina,
>  > Pabellón 8, Avda. Complutense, s/n, 28040 Madrid, Spain,
>  >
>  > email: moratti at gbt.tfo.upm.es <mailto:moratti at gbt.tfo.upm.es>
>  >          moratti at med.ucm.es
>  > Tel.:    +34 91 394 2292
>  > Fax.:   +34 91 394 2294
>  > */
>  > /*
>  >
>  > _______________________________________________
>  > R-sig-mixed-models at r-project.org mailing list
>  > https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>  >
>
>  _______________________________________________
>  R-sig-mixed-models at r-project.org mailing list
>  https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>




More information about the R-sig-mixed-models mailing list