Skip to content

lme4 : lmer : convergence problem and other errors

10 messages · Doran, Harold, yufeng at nsm.umass.edu, Gillian Raab +2 more

#
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
4 days later
#
There is no way to know what is going on given your description below.
You say you're fitting a non-linear model, but your notation is of a
linear model. I see you square a covariate, but this doesn't make it a
non-linear model, it is still linear in the parameters.

We don't know anything about your data, your lmer syntax, all of which
would be useful in helping you out.
#
Please see below:
I used the most up-to-date version.
How could I increase the iterations?
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!
You are right the model should be linear.
#
Thank for your suggestions but why u want to center x variables around zero in
that way? I just don't understand what is the advantage by doing that.

Yufeng

Quoting Gillian Raab <gillian.raab at googlemail.com>:
#
I'll add 2 cents worth here:  I have long advocated subtracting off a nice
round number near the middle of the range of x values, rather than using the
mean of the x values in the current data set.  This has a number of advantages,
including ease of interpretation and the ability of others to easily reproduce
the results and/or generate predicted values from the fitted model.  The same
argument applies to rescaling data by e.g. shifting the decimal point rather
than "standardizing" x.

Regards,    Rob Kushler
Gillian Raab wrote:
1 day later
#
On Tue, Jul 8, 2008 at 8:53 AM, Gillian Raab
<gillian.raab at googlemail.com> wrote:
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.
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.