[R] NLS "Singular Gradient" Error

Ben Bolker bolker at ufl.edu
Wed Apr 28 14:10:10 CEST 2010


Gabor Grothendieck <ggrothendieck <at> gmail.com> writes:

> 
> Your model is not identifiable.  The model contains the exponential of
> a linear function of Ne but such a function can be described in two
> parameters and you have three.  Perhaps you know T?  If that is the
> case remove it from the start list and set it to the known value T <-
> ... before running nls.
> 
> On Wed, Apr 28, 2010 at 7:43 AM, bsnrh <bsnrh <at> leeds.ac.uk> wrote:
> >
> > Hello,
> >
> > I am trying to model a type II functional response of number of prey eaten
> > (Ne) against number supplied (No) with a non-linear least squares regression
> > (nls). I am using a modification of Holling's (1959) disc equation to
> > account for non-replacement of prey;
> >
> > Ne=No{1-exp[a(bNe-T)]}
> >
> > where a is the attack rate, b is the handling time, and T is the
> > experimental period.
> >
> > My script is as follows;
> >
> > model<-nls(Ne~No*(1-exp(a*(b*Ne-T))),start=list(a=1.2,b=0.015,T=24))

  Are you trying to fit the Rogers random predator equation?
  This can't be estimated by standard methods, but there is a long
history of alternative solutions.
  See the ?lambertW function in the emdbook package (for example) ...

  Ben Bolker



More information about the R-help mailing list