[R] Problems with nlme: Quinidine example

Douglas Bates dmbates at gmail.com
Fri Jul 8 14:01:07 CEST 2005


On 7/8/05, Dieter Menne <dieter.menne at menne-biomed.de> wrote:
>  <rich <at> mi.fu-berlin.de> writes:
> 
> >
> > This concerns the "Clinical Study of Quinidine" example on page 380
> > of the book "Mixed-Effects Models in S and S-PLUS" by Pinheiro and Bates
> (2000).
> >
> > I have tried to reproduce the example, but get an error:
> ......
> >         system is computationally singular: reciprocal condition number =
> > 6.61723e-17
> >
> 
> In R, the underlying non-linear solver is different from that used in S. In
> general, I found the S-version converged in more cases than the R-version, but
> the opposite may also be true.
> 
> Sometimes it helps to fiddle with the control parameters on nlme, for example I
> got around some ping-ponging by setting pnlsTol to a large value, but check the
> sanity of your results. Looks like this will not help in this case, as in
> library\nlme\scripts\ch08.R Douglas Bates has added the following:
> 
> ## This fit just ping-pongs.
> #fm1Quin.nlme <-
> #  nlme(conc ~ quinModel(Subject, time, conc, dose, interval,
> #                        lV, lKa, lCl),
> 

Thanks for pointing that out Dieter.  I would have responded myself
except for more urgent matters intervening in the last few days.

The optimizer code that was (and, I imagine, still is) used in S-PLUS
will be available starting with R-2.2.0.  I have modified the lmer
function to use R's nlminb optimizer when available and will do the
same for the nlme package.  That should improve consistency of results
between the S-PLUS and the R versions of nlme.




More information about the R-help mailing list