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
nl regression with 8 parameters, help!
3 messages · Guillaume STORCHI, Arne Henningsen, Peter Dalgaard
Does this error always occur independently of the starting values that you
provide? I guess so, because I think that the parameters in your equation are
not identifiable, since the first term (a1 to a4) is identical to the second
term (b1 to b4) with a1 = b1, -a2 = b2, a3 = -b3, and a4 = b4 .
Do you really want to have the same explanatory variable ("Tl") in both terms?
Arne
On Wednesday 23 March 2005 16:28, Guillaume STORCHI wrote:
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
______________________________________________ R-help at 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
Arne Henningsen Department of Agricultural Economics University of Kiel Olshausenstr. 40 D-24098 Kiel (Germany) Tel: +49-431-880 4445 Fax: +49-431-880 1397 ahenningsen at agric-econ.uni-kiel.de http://www.uni-kiel.de/agrarpol/ahenningsen/
Arne Henningsen <ahenningsen at email.uni-kiel.de> writes:
Does this error always occur independently of the starting values that you
provide? I guess so, because I think that the parameters in your equation are
not identifiable, since the first term (a1 to a4) is identical to the second
term (b1 to b4) with a1 = b1, -a2 = b2, a3 = -b3, and a4 = b4 .
Do you really want to have the same explanatory variable ("Tl") in both terms?
That's not necessarily a problem. There will of course always be two solutions, but the algorithm may still converge to one of them. This happens all the time with biexponential curves, e.g.. However, in this case we have a local unidentifiability too: if you multiply a1 and a4 by a constant and divide b1 and b4 by the same constant, you get the same fitted values. This is reflected in the singular gradient.
On Wednesday 23 March 2005 16:28, Guillaume STORCHI wrote:
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))
O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907