Solved – Fitting a non-linear random effects model with binomial error structure

binomial distributionnonlinear regressionrrandom-effects-model

I've got a non-linear model that I've been applying to some data of repeated binary outcomes. I have data for multiple years, and I'd like to add random effects (by year) for two of my parameters. Looking at the lme4 package in R, it seems that it supports non-Gaussian error structure and nonlinear models, but not simultaneously. Is there a way around this, or another package I could be using? I hear ADMB has a steep learning curve, so I'd prefer not to tackle that.

Without random effects, my model is quite simple–only 4 parameters and I've been able to fit it using a formula call to the mle2 function from the bbmle package.

Best Answer

It seems this is not possible in lme4, where you can pick any two of {nonlinear, mixed effects, binomial error error distribution}, but not all three. The better solution would be to use Stan/JAGS/BUGS.