Hello, I am trying to do a nonlinear model using the "nls" command in R software. The data I am using is as follows: A<-c(7.132000,8.668667,9.880667,8.168000,10.863333,10.381333,11.059333,7.589333,4.716667,4.268667,7.265333,10.309333,8.456667,13.359333,8.624000,13.571333,12.523333,4.084667 ,NaN,NaN) Pot<-c(21.700000,16.700000,16.400000,17.200000,17.833333,18.266667,18.966667,18.400000,19.100000,18.333333,16.333333,21.466667,7.033333,NaN,6.366667,6.700000,16.633333,15.666667 ,17.883333,NaN) When using the nls command I recieve an error like this: >mod = nls(A~ Amax * (1-exp(-b*Pot)),start=list(Amax=10,b=0.003)) / / Error in nls(A~ Amax * (1 - exp(-b * Pot), start = list(Amax = 10, : / step factor 0.000488281 reduced below 'minFactor' of 0.000976562 /I suppose that the used model is wrong, specialy Amax. I studied somewhere I should use "plinear" model but I did not know. If you can guide me, any advices would be realy appreciated. Thank you in advance,/ Best regards, Mitra RAHMATI/ [[alternative HTML version deleted]]
Mitra You have a couple of problems. First, if you plot the data (plot(A~Pot)) you'll see there's little chance that an asymptotic, exponential equation describes your data because they don't rise from zero to Amax as your model assumes. If Pot is your only independent variable, the best model I see from looking at the plot is simple Apred = mean(A). It may be so because the b value is not 0.003 as you use for the starting point, but a much larger number so that the rise to the asymptote has occurred before data collection began, so that your A variable represents Amax with a lot of scatter. Second, and more important, even though the model 'may be' correct (always an assumption in nls that must be tested post hoc), your experiments appear to contain no independent information concerning the values of the parameters. This would yield the error message you are getting from nls, which is really saying that the sum-of-squares surface is insensitive to changes in Amax and b so the search algorithm is lost trying to find a minimum value that likely doesn't exist. You are a long way from worrying about whether to use plinear - you're problem is more fundamental. Plot the data, then plot a line that follows your model and ask yourself whether the model looks like the data. Good luck David Stevens On 10/24/2011 8:47 AM, mitra Rahmati wrote:> mod = nls(A~ Amax * (1-exp(-b*Pot)),start=list(Amax=10,b=0.003))[[alternative HTML version deleted]]