[R] start values for nls() that don't yield singular gradients?

From: James Salsman <james_at_bovik.org>
Date: Sat 23 Apr 2005 - 18:04:20 EST

I'm trying to fit a Gompertz sigmoid as follows:

x <- c(15, 16, 17, 18, 19) # arbitrary example data here; y <- c(0.1, 1.8, 2.2, 2.6, 2.9) # actual data is similar

gm <- nls(y ~ a+b*exp(-exp(-c*(x-d))), start=c(a=?, b=?, c=?, d=?))

I have been unable to properly set the starting value '?'s. All of my guesses yield either a "singular gradient" error if they are decent guesses, or a "singular gradient matrix at initial parameter estimates" error if they are bad guesses like all zeros.

How can I pick starting values that don't result in singular gradients?

I have had no luck with the "selfStart" models, e.g., "SSgompertz" -- the formula in "SSgompertz" is not the same as the one I need above, since it has three parameters instead of four. I've tried it and SSfpl thusly:

> getInitial(y ~ SSfpl(x,a,b,c,d),data=data.frame(x=x,y=y))
Error in nls(y ~ cbind(1, 1/(1 + exp((xmid - x)/exp(lscal)))), data = xy, :

         step factor 0.000488281 reduced below `minFactor' of 0.000976563

And this:

> getInitial(y ~ SSgompertz(x,a,b,c),data=data.frame(x=x,y=y))
Error in nls(y ~ cbind(1, 1 - exp(-exp(lrc) * x)), data = xy, start = list(lrc = as.vector(log(-coef(lm(log(abs(y - :

         singular gradient

Thanks for any help.

James Salsman

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sat Apr 23 18:10:27 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:23 EST