[R-sig-ME] can't get model to converge

Andrew Robinson A.Robinson at ms.unimelb.edu.au
Tue Jul 13 06:11:12 CEST 2010


Hi Michael,

a few thoughts ...

0) how many fish do you have?  And, how many measurements per fish?

1) are you sure that you need all three parameters to be random?
   Judicious use of nlslist and some graphics might provide insight as
   to whether any of them can be simply fixed effects.  Doing so will
   greatly simplify the model, See Section 8.1.3 of P&B.

2) I've fit models that have required more than 5000 iterations to
   converge.  Try increasing the iterations to 10000.

3) Just as a side-note, I find your code hard to read.  I know that
   the choice between '=' and '<-' is a matter of taste, but please
   make more use of spaces!

I hope that this helps,

Andrew

On Mon, Jul 12, 2010 at 11:06:03PM -0400, Michael Larkin wrote:
> I know my convergence problem is not a new one to this email list.  I looked
> at old post and I still can't figure out my problem.  This is why I am
> sending this email.  
> 
>  
> 
> Here is my situation:  
> 
>  
> 
> I have back-calculated fish growth using otoliths (ear bones).  In a
> nutshell you can back calculate the length of the fish at each age by
> measuring the distance from the core of the otolith to each annuli and the
> edge of the otolith.  Since the data is longitudinal, autocorrelated, and
> unbalanced the best way to generate a growth curve is using a non-linear
> mixed effect model (Vigliola and Meekan 2009).  
> 
>  
> 
> I have three columns of data: fish identification number (id), length at age
> (L), and incremental age (Age).  
> 
>  
> 
> Here is my code:  
> 
> #first I create my growth model which is the von Bertalanffy growth model
> (LVB)
> 
> >LVB=function(x,t0,Lmax,K){                                               
> 
> >y=Lmax*(1-exp(-K*(x-t0)))
> 
> 
> >y
> 
> >}
> 
>  
> 
> #I define the groups for the mixed effect model.  
> 
> >datagr=groupedData(L~Age|id,data=back)
> 
>  
> 
> #The next step fits a von Bertalanffy growth model by non-linear mixed
> effect model.  
> 
> >LVB.nlme=nlme(L~LVB(Age,t0,Lmax,K), data=datagr, 
> 
> >fixed=list(t0~1,Lmax~1,K~1),         #The model is estimating global values
> for all three parameters. 
> 
> >random=t0+Lmax+K~1,                  #The model is estimating values for
> each parameter for 
> 
> each individual fish.  This is the random effect part of the model.  
> 
> >start=list(fixed=c(t0=-1, Lmax=700, K=0.2)))         #list creates a list
> of the arguments, fixed means 1 single fixed effect, c means create a data
> vector.  
> 
>  
> 
> I keep getting the error of "Maximum number of iterations".  I have tried
> different starting values and still have no luck.  I even tried 
> 
> increasing the number of iterations to 1,000 using nlmeControl.  
> 
>  
> 
> Any advice on how to get my model to converge would be greatly appreciated.
> 
> 
>  
> 
> Mike 
> 
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

-- 
Andrew Robinson  
Program Manager, ACERA 
Department of Mathematics and Statistics            Tel: +61-3-8344-6410
University of Melbourne, VIC 3010 Australia               (prefer email)
http://www.ms.unimelb.edu.au/~andrewpr              Fax: +61-3-8344-4599
http://www.acera.unimelb.edu.au/




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