Hi! I have a problem of curve fitting. I use the following data : - vector of predictor data : 0 0.4 0.8 1.2 1.6 - vector of response data : 0.81954 0.64592 0.51247 0.42831 0.35371 I perform parametric fits using custom equations when I use this equation : y = yo + K *(1/(1+exp(-(a+b*ln(x))))) the fitting result is OK but when I use this more general equation : y = yo + K *(1/(1+exp(-(a+b*log(x)+c*x)))) , then I get an aberrant curve! I don't understand that... The second fitting should be at least as good as the first one because when taking c=0, both equations are identical! There is here a mathematical phenomenon that I don't understand!....could someone help me???? Thanks a lot in advance! Nadège [[alternative HTML version deleted]]
<ndurand <at> fr.abx.fr> writes:> > Hi! > > I have a problem of curve fitting.> > I perform parametric fits using custom equations > > when I use this equation : y = yo + K *(1/(1+exp(-(a+b*ln(x))))) the > fitting result is OK > but when I use this more general equation : y = yo + K > *(1/(1+exp(-(a+b*log(x)+c*x)))) , then I get an aberrant curve! > > I don't understand that... The second fitting should be at least as good > as the first one because when taking c=0, both equations are identical! >Can you specify *exactly* what R code you're using? Are you using nls()? You're trying to fit a five-parameter model to five data points, which is likely to be difficult if not impossible to do statistically. Furthermore, your data points don't have very much information in them about all the parameters you're trying to estimate -- they are steadily decreasing, with very mild curvature. Finally, if these "data" happen to be points that you have generated as theoretical values, without adding noise, nls will give you problems (see ?nls). If you give us more detail about what you're trying to do we might be able to help (or possibly tell you that it really can't work ...) Ben Bolker
You haven't told us how you are fitting the model; are you using nls(), and if so with what initial values? The models don't make sense at x=0, due to the inclusion of the log(x) term. Ignoring that, you have 5 observations and 5 parameters in your second model. What is the reason you are including both "b*log(x)" and "c*x" terms in the model? regards albyn ----------------------------------------------------------------------- On Thu, Jan 12, 2006 at 07:11:12PM +0100, ndurand at fr.abx.fr wrote:> Hi! > > I have a problem of curve fitting. > > I use the following data : > > - vector of predictor data : > 0 > 0.4 > 0.8 > 1.2 > 1.6 > > - vector of response data : > 0.81954 > 0.64592 > 0.51247 > 0.42831 > 0.35371 > > I perform parametric fits using custom equations > > when I use this equation : y = yo + K *(1/(1+exp(-(a+b*ln(x))))) the > fitting result is OK > but when I use this more general equation : y = yo + K > *(1/(1+exp(-(a+b*log(x)+c*x)))) , then I get an aberrant curve! > > I don't understand that... The second fitting should be at least as good > as the first one because when taking c=0, both equations are identical! > > There is here a mathematical phenomenon that I don't understand!....could > someone help me???? > > Thanks a lot in advance! > > Nad?ge > > [[alternative HTML version deleted]] >> ______________________________________________ > 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
I made a mistake in my equations : all the logarithms are neperian! ----- Réacheminé par Nadege ND Durand/RD/abx/FR le 01/13/2006 09:15 ----- Nadege ND Durand 01/12/2006 19:11 Pour : r-help@lists.R-project.org cc : Objet : Curve fitting Hi! I have a problem of curve fitting. I use the following data : - vector of predictor data : 0 0.4 0.8 1.2 1.6 - vector of response data : 0.81954 0.64592 0.51247 0.42831 0.35371 I perform parametric fits using custom equations when I use this equation : y = yo + K *(1/(1+exp(-(a+b*ln(x))))) the fitting result is OK but when I use this more general equation : y = yo + K *(1/(1+exp(-(a+b*log(x)+c*x)))) , then I get an aberrant curve! I don't understand that... The second fitting should be at least as good as the first one because when taking c=0, both equations are identical! There is here a mathematical phenomenon that I don't understand!....could someone help me???? Thanks a lot in advance! Nadège [[alternative HTML version deleted]]