[R-sig-ME] non-linear mixed effects: polynomial

Ben Bolker bbolker at gmail.com
Tue Sep 20 00:21:03 CEST 2011


Gabriel Yvon-Durocher <g.yvon-durocher at ...> writes:

> 
> Dear all,
> 
> I am trying to fit a 3rd order polynomial to some rate and temperature
measurements, but am running into
> problems. I would like to treat the parameter a,b,c,d as random effects across
subjects, and use the model
> to estimate these parms for each experimental subject.
> 
> Here is my model:
> 
>     resp.fun<-function(Temp,a,b,c,d) -a*(Temp^3)+b*(Temp^2)-c*(Temp)+d
> 
> then I build a gradient function:
> 
>     gr.model<- deriv(body(resp.fun), namevec = c('a','b','c','d'),
function.arg = resp.fun)
> 
> and then run the mixed effects model:
> 
>     model<-nlmer(log10.rate ~ gr.model(Temp,a,b,c,d) ~ 1+a+b+c+d|Subject,
>     	start = c(a=4.897e-05, b=3.198e-03, c=3.569e-02, d=1),
>     	data = lab.analysis,
>     	na.action=na.omit)
> 
> unfortunately I get the error message 
> 
>     Warning message:
>     In mer_finalize(ans) : false convergence (8)
> 
> Any ideas on what I may be doing wrong? 
> I have manually fit this polynomial to the data for each subject and the
> fits are good, but I want to run the mixed effects analysis to get the best 
> possible parameter estimates
> given the experimental design.
> 

  How many subjects?

  Can you do it in nlme instead, which is more mature/robust?
  If not, you may end up needing to do this in AD Model Builder, or BUGS,
or rolling your own Laplace approximator (there is an example
in Madsen and Thyregod's book) ...

  Ben Bolker




More information about the R-sig-mixed-models mailing list