[R] An error in fitting a non linear regression

Christian Ritz ritz at life.ku.dk
Fri Feb 20 11:57:04 CET 2009


Hi Saeed,

one approach is to try out several initial value combinations for a and b.

It often helps to find initial values of the same order of magnitude and of the same sign
as the final estimates.

To get such initial values, you could linearize the model:

lm(log(q) ~ I(-depth))


and supply the estimated coefficients from the linear regression as starting values:

nreg <- nls(q ~ a*exp(-b*depth), start = list(a = 0.76168, b = -0.08484))
summary(nreg)


Christian




More information about the R-help mailing list