[R] nl regression with 8 parameters, help!

Guillaume STORCHI nioniodesbois at yahoo.fr
Wed Mar 23 16:28:41 CET 2005


I'm doing a non linear regression with 8 parameters to be fitted:

J.Tl.nls<-nls(Gw~(a1/(1+exp(-a2*Tl+a3))+a4)*(b1/(1+exp(b2*Tl-b3))+b4),data=Enveloppe,
                       start=list(a1=0.88957,a2=0.36298,a3=10.59241,a4=0.26308,
                                 
b1=0.391268,b2=1.041856,b3=0.391268,b4=0.03439))

   First, I fitted my curve on my data by guessing the parameters' values ("by
hand"), and wrote them. 
   Then, I ajusted my model only with two parameters (whereas the others were
fixed with previously found values, I did it the same way for all parameters. 
   Finally, I got 8 fitted values that I enventually embedded in my nls()
function, like above, yet R talled me: 
"Error in nlsModel(formula, mf, start) : singular gradient matrix at initial
parameter estimates"

should I use optim() or optimize()? 
How could I perform it?

Thanks for help

Guillaume Storchi




More information about the R-help mailing list