Re: Levenberg-Marquardt non-linear least-squares fitting in Python [follow-on]

2019-03-29 Thread edmondo . giovannozzi
> ltemp = [ydata[i] - ydata[0] for i in range(ll)] > ytemp = [ltemp[i] * .001 for i in range(ll)] > ltemp = [xdata[i] - xdata[0] for i in range(ll)] > xtemp = [ltemp[i] * .001 for i in range(ll)] Use the vectorization given by numpy: ytemp = (ydata - ydata[0]) * 0.001

Re: Levenberg-Marquardt non-linear least-squares fitting in Python [follow-on]

2019-03-28 Thread William Ray Wing via Python-list
Below I’ve included the code I ran, reasonably (I think) commented. Note the reference to the example. The data actually came from a pandas data frame that was in turn filled from a 100 MB data file that included lots of other data not needed for this, which was a curve fit to a calibration ru

Re: Levenberg-Marquardt non-linear least-squares fitting in Python

2019-03-28 Thread Madhavan Bomidi
Hi Bill, Thanks for your suggestion. Where am I actually using the curve_fit in the defined function func2fit? Don't I need to initial assumption of a, b and c values so that optimized convergence occur with iteration of the function for the input data of x? Look forward to your suggestions, M

Re: Levenberg-Marquardt non-linear least-squares fitting in Python

2019-03-28 Thread William Ray Wing via Python-list
> On Mar 28, 2019, at 7:54 AM, Madhavan Bomidi wrote: > > Hi, > > I have x and y variables data arrays. These two variables are assumed to be > related as y = A * exp(x/B). Now, I wanted to use Levenberg-Marquardt > non-linear least-squares fitting to find A and B for the best fit of the >

Levenberg-Marquardt non-linear least-squares fitting in Python

2019-03-28 Thread Madhavan Bomidi
Hi, I have x and y variables data arrays. These two variables are assumed to be related as y = A * exp(x/B). Now, I wanted to use Levenberg-Marquardt non-linear least-squares fitting to find A and B for the best fit of the data. Can anyone suggest me how I can proceed with the same. My intentio