[R] NLS "Singular Gradient" Error

Gabor Grothendieck ggrothendieck at gmail.com
Wed Apr 28 13:57:41 CEST 2010


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))
>
> This returns the following error;
>
> "Error in nlsModel(formula, mf, start, wts) : singular gradient matrix at
> initial parameter estimates".
>
> Can anyone please advise as to what I may be doing wrong? I have tried
> modifying the parameter start points with no success.
>
> Many thanks,
> --
> View this message in context: http://r.789695.n4.nabble.com/NLS-Singular-Gradient-Error-tp2069029p2069029.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list