I'm about to attempt to fit a non-linear mixed effects model $(A + B*e^t)$ in lme4. I've already tried fitting this model in nlme with some difficulty due to noise within the data. However, I understand that lme4 has more robust algorithms that's able to better fit non-linear models such as the one written above.

I've ready a few posts such as How to choose nlme or lme4 R library for mixed effects models?

My question: Is lme4 better than nlme with non-linear models? (nlme vs nlmer)

  • 2
    $\begingroup$ What are your criteria for "better"? $\endgroup$
    – goangit
    Dec 1, 2014 at 19:30
  • $\begingroup$ @goangit, By "better", is it more flexible in terms of convergence and fitting of models to data that has a lot of noise? I've noticed that the nlme algorithm is not as flexible and I've had great difficulty with fitting models to noisy data. $\endgroup$
    – John_dydx
    Dec 2, 2014 at 11:29

1 Answer 1


Don't know if this is discussed or formerly covered elsewhere, but the major differences are:

  • structure in residuals (favours nlme): as with the lme vs. lmer comparison, nlme can be used in conjunction with the package's corStruct and varStruct capabilities to fit models with autocorrelation and heteroscedasticity
  • documentation (favours nlme): nlme is well-documented in Pinheiro and Bates's 2000 Springer book.
  • fixed-effects structure (nlme): nlme makes it (much) easier to include non-trivial fixed effects in the model. As documented here, it is theoretically possible but quite difficult to include fixed effects; this is in large part because the derivatives have to be explicitly specified for nlmer.
  • speed, capability for crossed random effects (nlmer): the machinery underlying nlmer is more sophisticated/modern than that of nlme, which suggests that it should be faster and possibly more stable for large problems.

Why don't you try it and see?

  • $\begingroup$ thanks for your comments. Indeed, I totally agree with your comment about the documentation-I chose nlme initially partly because of the Bates book. So far, non linear modelling is not well documented in lme4-still looking for resources that can help me understand the syntax, etc. Thanks for the comments too-I think I'll give it a go. If you're aware of any books or documents on non-linear modelling in lme4, I would be very interested in having a look at them. $\endgroup$
    – John_dydx
    Dec 2, 2014 at 11:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.