Henri Mone <henriMone <at> gmail.com> writes: > I want to fit to my data an exponential function with following > functional form: > y=exp(a*x) > > I used the function "nls" but this gives me exponential fits with > following functional form: > y=l*exp(a*x) > > With "l" being an scaling factor. What do I need to change in my R code? > > t.dataFitModel=nls(t.dataForFitY ~exp(a*t.dataForFitX), > data=t.dataForFit, start=list(a = 0.01242922), trace=TRUE, algorithm = > "plinear")
Use an algorithm other than "plinear", I think (admittedly this is not at all clear from ?nls -- you would really have to go to the references to find out). ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.