[R-sig-ME] [R] lme4 : lmer : convergence problem and other errors
Douglas Bates
bates at stat.wisc.edu
Thu Jul 10 18:49:15 CEST 2008
On Tue, Jul 8, 2008 at 8:53 AM, Gillian Raab
<gillian.raab at googlemail.com> wrote:
> 2008/7/8 <yufeng at nsm.umass.edu>:
>
>> Please see below:
>>
>> > 1) What version of lmer are you running? The new version post 23/6/08
>> copes
>> > with difficult likelihoods better.
>>
>> I used the most up-to-date version.
The description "most up-to-date" can become wrong very quickly. It
is better to quote a version number. Use
sessionInfo()
to get the version number.
>> > 2) Have you changed anything in the elements of the control parameter.
>> The
>> > pre 23/6 verion had several parameters and the later one fewer. In
>> > particular you can increase the iterations
>>
>> How could I increase the iterations?
>
> READ THE HELP FILE UNDER LMER AND THE CONTROL PARAMETER
Well, actually, current versions of the help file should say that the
only control parameter recognized is msVerbose, which is the old way
of setting the "verbose" argument. Martin Maechler has pointed out on
several occasions that I should allow the maximum number of iterations
to be reset (also, the maximum number of function evaluations) but I
haven't done that yet.
There is a horrible hack that can be used to provide a greater number
of iterations. The arguments to the C function "mer_optimize" are an
mer object and a verbose flag. If the model fit fails because the
optimizer has exceeded the number of iterations you can take the
returned object and feed it directly back into
.Call("mer_optimize", <failed_lmer_fit>, FALSE, PACKAGE = "lme4")
As I say, this is a horrible hack and I should make it possible to set
the maximum number of iterations in the call to lmer rather than doing
this. However, doing so would involve creating the appropriate
argument names and defaults and my experience is that if this is done
hastily I end up regretting the resulting awkwardness.
>>
>>
>> > 3) Have you centred your x variables so they have means around zero. If
>> not
>> > you should always do this as it will make the fitting easier especially
>> with
>> > quadratic terms. This ought to have been my first suggestion.
>>
>> Do u mean the random effects of x's should be centered around 0? I didn't
>> do
>> that and I don't know how to do that in R? Could U tell me how? Thanks!
>
> NOTHING FANCY JUST CALCULATE NEW X VARIABLES BY SUBTRACTING THE MEAN VALUES
>
>>
>>
>>
>>
>> > 4) Having another look at your model you say it is non-linear, but it
>> looks
>> > linear to me if you set the squared terms as covariates too.
>>
>> You are right the model should be linear.
>>
>> >
>> > Good luck
>> >
>> > Gillian Raab
>> > Edinburgh
>> >
>> > On 03/07/2008, yufeng at nsm.umass.edu <yufeng at nsm.umass.edu> wrote:
>> > >
>> > > Dear R-user,
>> > >
>> > > I am trying to use the R "lmer" function in lme4 package to fit a non
>> > > linear
>> > > mixed effects model. The model I wand to fit is at an individual level
>> with
>> > > 4
>> > > parameters. For all parameters both fixed and random effects have to be
>> > > estimated, as well as their covariance matrix (see the formula bellow).
>> > > y~x1+x1^2+x2+x2^2.
>> > >
>> > >
>> > > I tried to fit the model with my data sets, but most of the time, R
>> returns
>> > > an
>> > > error message.
>> > > there are three main types of errors :
>> > >
>> > > - In mer_finalize(ans, verbose) :
>> > > function evaluation limit reached without convergence (9)
>> > >
>> > > - there are false convergence (8)
>> > >
>> > > -there are singular convergence (7)
>> > >
>> > > Do you know how to resolve these problems. Is there a way to modify the
>> > > parameters of the maximization algorithm to avoid these error messages?
>> > >
>> > > Thank you for your help and answers.
>> > >
>> > > Regards,
>> > >
>> > > Yufeng Zhang
>> > >
>> > > _______________________________________________
>> > > R-sig-mixed-models at r-project.org mailing list
>> > > https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>> > >
>> >
>> >
>> >
>> > --
>> > Gillian M Raab
>> > 10 Ainslie Place EH3 6AS
>> > tel 0131 226 6234
>> > mobile 07748 678 551
>> >
>>
>>
>>
>>
>
>
> --
> Gillian M Raab
> 10 Ainslie Place EH3 6AS
> tel 0131 226 6234
> mobile 07748 678 551
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> 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