All - I have data: TL age 388 4 418 4 438 4 428 5 539 10 432 4 444 7 421 4 438 4 419 4 463 6 423 4 ... [truncated] and I'm trying to fit a simple Von Bertalanffy growth curve with program: #Creates a Von Bertalanffy growth model VonB=nls(TL~Linf*(1-exp(-k*(age-t0))), data=box5.4, start=list(Linf=1000, k=0.1, t0=0.1), trace=TRUE) #Scatterplot of the data plot(TL~age, data=box5.4, pch=19, xlab="Age (yr)", ylab="Total length (mm)") #Incorporates the model VonB onto the called scatterplot mod1a=seq(2, 11, by=0.001) lines(mod1a, predict(VonB, list(age = mod1a)), col="blue", lwd=2) #summarizes the model VonB with the model formula, parameter estimates, std. errors, #and a correlation matrix summary(VonB, corr=T) #Provides 95% confidence intervals for the parameter estimates confint(VonB) Everything works as it should right up until the confint(VonB) statement. When I ask for the confidence intervals, R goes through the process then stops and gives "Error in prof$getProfile() : step factor 0.000488281 reduced below 'minFactor' of 0.000976562". However, when I use nls.control=(minFactor=0.000001) OR nls.control(minFactor=0.000001), I get the same error. I'm at a loss. I'm not sure what else I can do to have R reduce the step size if it's not nls.control(). Thanks, SR Steven H. Ranney Graduate Research Assistant (Ph.D) USGS Montana Cooperative Fishery Research Unit Montana State University P.O. Box 173460 Bozeman, MT 59717-3460 phone: (406) 994-6643 fax: (406) 994-7479 [[alternative HTML version deleted]]
Ranney, Steven <steven.ranney <at> montana.edu> writes:> > and I'm trying to fit a simple Von Bertalanffy growth curve with program: > > VonB=nls(TL~Linf*(1-exp(-k*(age-t0))), data=box5.4, > start=list(Linf=1000, k=0.1, t0=0.1), trace=TRUE)...> Everything works as it should right up until the confint(VonB) statement.When I ask> for the confidence intervals, R goes through the process then stops and gives > > "Error in prof$getProfile() : > step factor 0.000488281 reduced below 'minFactor' of 0.000976562". > > However, when I use nls.control=(minFactor=0.000001) ORnls.control(minFactor=0.000001), In my experience, it never helps to reduce the control factors once this error comes up; it is a problem that by profiling you hit a boundary where convergence problems are serious. Suggestions: first, try with some smaller p-value, e.g. 0.8 or 0.7 instead of the default of 0.95; profiling will stay in safer region. It may be possible to use algorithm "port" in combination with lower/upper, but I am not sure if this is honoured by profile. Dieter
>> >> and I'm trying to fit a simple Von Bertalanffy growth curve with program: >> >> VonB=nls(TL~Linf*(1-exp(-k*(age-t0))), data=box5.4, >> start=list(Linf=1000, k=0.1, t0=0.1), trace=TRUE) >>... >> Everything works as it should right up until the confint(VonB) statement. >>When I ask >> for the confidence intervals, R goes through the process then stops and gives >> >> "Error in prof$getProfile() : >> step factor 0.000488281 reduced below 'minFactor' of 0.000976562". >> >> However, when I use nls.control=(minFactor=0.000001) OR >> nls.control(minFactor=0.000001),>In my experience, it never helps to reduce the control factors once this error >comes up; it is a problem that by profiling you hit a boundary where >convergence problems are serious. > >Suggestions: first, try with some smaller p-value, e.g. 0.8 or 0.7 instead of >the default of 0.95; profiling will stay in safer region. > >It may be possible to use algorithm "port" in combination with lower/upper, but >I am not sure if this is honoured by profile. > >DieterI adjusted the nls() statement by adding the algorithm="port" statement. Without changing the confint(vonB) request or including a lower/upper statement (I'm still not sure what they do), I was given 2.5% 97.5% Linf 462.8386 NA k NA 0.6944959 t0 NA 0.7973458 It's not until I get down to confint(VonB, level=.31) that I get confidence interval values for all of the parameter estimates in the model. Any thoughts or ideas as to why? Steven H. Ranney Graduate Research Assistant (Ph.D) USGS Montana Cooperative Fishery Research Unit Montana State University P.O. Box 173460 Bozeman, MT 59717-3460 phone: (406) 994-6643 fax: (406) 994-7479 [[alternative HTML version deleted]]