[R] nls: Missing value or an Infinity produced when evaluating the model

Angel - angel_lul at hotmail.com
Wed Apr 23 14:29:44 CEST 2003


Hi,
I am trying to fit a sigmoid curve to some data with nls but I am getting 
into some trouble.
Seems that the optimization method is getting down to some parameter 
estimates that make the equation unsolvable. This is an example:

>growth<-data.frame(Time=c(5,7,9,11,13,15,17,19,21,23,25,27),BodyMass=c(45,85,125,210,300,485,570,700,830,940,1030,1120))

>GrowthModel<-nls(BodyMass~(((1-(1-((BirthMass/MaxMass)^0.25))*exp(-a*Time/(4*MaxMass^0.25)))^4)*MaxMass),data=growth,start=c(BirthMass=3,MaxMass=2500,a=1.5),trace=TRUE)

56043.86 :     3.0 2500.0    1.5
Error in numericDeriv(form[[3]], names(ind), env) :
        Missing value or an Infinity produced when evaluating the model

Is there anyway I can restrict the parameter values used so it doesn't get 
to this no return point.
Any other alternatives are also very welcome!
Thanks in advance,
Angel





_________________________________________________________________
Hotmail messages direct to your mobile phone http://www.msn.co.uk/mobile



More information about the R-help mailing list