4

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)

John_dydx
  • 593
  • 1
  • 5
  • 19
  • 2
    What are your criteria for "better"? – goangit Dec 01 '14 at 19:30
  • @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. – John_dydx Dec 02 '14 at 11:29

1 Answers1

8

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?

Ben Bolker
  • 34,308
  • 2
  • 93
  • 126
  • 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. – John_dydx Dec 02 '14 at 11:34