Skip to content
Advertisement

Tag: curve-fitting

How to write a function to fit data to a sum of N Gaussian-like peaks without explicitly defining the expression for every possible N?

I am trying to fit a progression of Gaussian peaks to a spectral lineshape. The progression is a summation of N evenly spaced Gaussian peaks. When coded as a function, the formula for N=1 looks like this: where A, e0, hf, S and fwhm are to be determined from the fit with some good initial guesses. Importantly, the parameter i

fitting closed curve to a set of noisy points

This is my set of data, where I would like to fit a closed curve to, just like this post here is the visualized dataset: However, these are the results I got no matter how I sort my array. I pinned a few problems about my dataset but don’t know how to deal with them: Many x and y values

Polynomial fitting with equal number of data points and coefficients

I am currently experimenting with polynomial fitting using jupyter. The function below returns the least-square polynomial of degree m given the data points in xs with corresponding ys. Suppose I have the following six data points and fit a polynomial of degree 5: From my understanding, the resulting curve should pass through every single data point exactly (in fact, the

Difference between Levenberg-Marquardt-Algorithm and ODR

I was able to fit curves to a x/y dataset using peak-o-mat, as shown below. Thats a linear background and 10 lorentzian curves. Since I need to fit many similar curves I wrote a scripted fitting routine, using mpfit.py, which is a Levenberg-Marquardt-Algorithm. However the fit takes longer and, in my opinion, is less accurate than the peak-o-mat result: Starting

Advertisement