[R] nls not solving

Schatzi adele_thompson at cargill.com
Mon Feb 28 21:23:02 CET 2011


I am running the following nls equation. I tried it with data that excel was
fitting and got the error: 
singular gradient matrix at initial parameter estimates 
I thought it was due to a low number of points (6), but when I create a
dataset, I get the same problem. If I remove the parameter "a," then it can
find a solution. Does anyone know what I can do to fit this model? 

vardata<- rnorm(73,mean=0,sd=5) 
x<-0:72 
a<-1 
b<-50 
k<-0.05 
l<-5 
startt<-c(a,b,k,l) 
yf<-a+b*(1-exp(-k*(x-l))) 
y<-yf+vardata 

nmodel<-nls(y~a+b*(1-exp(-k*(x-l))), 
start=list(a=1,b=50,k=0.05,l=5)) 

-- 
View this message in context: http://r.789695.n4.nabble.com/nls-not-solving-tp3328647p3328647.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list