data-fitting

Determining Fourier Coefficients from Time Series Data

Determining Fourier Coefficients from Time Series Data Question: I asked a since deleted question regarding how to determine Fourier coefficients from time series data. I am resubmitting this because I have better formulated the problem and have a solution that I’ll give as I think others may find this very useful. I have some time …

Total answers: 3

Minimizing a function using python for data fitting

Minimizing a function using python for data fitting Question: I have a function as the following q = 1 / sqrt( ((1+z)**2 * (1+0.01*o_m*z) – z*(2+z)*(1-o_m)) ) h = 5 * log10( (1+z)*q ) + 43.1601 I have experimental answers of above equation and once I must to put some data into above function and …

Total answers: 2

scipy.integrate Pseudo-Voigt function, integral becomes 0

scipy.integrate Pseudo-Voigt function, integral becomes 0 Question: I am writing a script for fitting peak shapes to spectroscopic data in Python, using Scipy, Numpy and Matplotlib. It can fit multiple peaks at once. The peak profile (for now) is Pseudo-Voigt, which is a linear combination of a Gaussian (aka Normal) and Lorentzian (aka Cauchy) distribution. …

Total answers: 1

How to find probability distribution and parameters for real data? (Python 3)

How to find probability distribution and parameters for real data? (Python 3) Question: I have a dataset from sklearn and I plotted the distribution of the load_diabetes.target data (i.e. the values of the regression that the load_diabetes.data are used to predict). I used this because it has the fewest number of variables/attributes of the regression …

Total answers: 6

Fitting a closed curve to a set of points

Fitting a closed curve to a set of points Question: I have a set of points pts which form a loop and it looks like this: This is somewhat similar to 31243002, but instead of putting points in between pairs of points, I would like to fit a smooth curve through the points (coordinates are …

Total answers: 4

fitting data with numpy

fitting data with numpy Question: I have the following data: >>> x array([ 3.08, 3.1 , 3.12, 3.14, 3.16, 3.18, 3.2 , 3.22, 3.24, 3.26, 3.28, 3.3 , 3.32, 3.34, 3.36, 3.38, 3.4 , 3.42, 3.44, 3.46, 3.48, 3.5 , 3.52, 3.54, 3.56, 3.58, 3.6 , 3.62, 3.64, 3.66, 3.68]) >>> y array([ 0.000857, 0.001182, …

Total answers: 3