Linked Questions

50 votes
7 answers
51k views

In python I have a function which has many parameters. I want to fit this function to a data set, but using only one parameter, the rest of the parameters I want to supply on on my own. Here is an ...
lovespeed's user avatar
  • 5,085
38 votes
3 answers
45k views

Is it possible a lambda function to have variable number of arguments? For example, I want to write a metaclass, which creates a method for every method of some other class and this newly created ...
brain_damage's user avatar
1 vote
3 answers
11k views

I have a function Imaginary which describes a physics process and I want to fit this to a dataset x_interpolate, y_interpolate. The function is a form of a Lorentzian peak function and I have some ...
STJ's user avatar
  • 113
3 votes
2 answers
3k views

I'm new to python (and programming in general) and want to make a polynomial fit using curve_fit, where the order of the polynomials (or the number of fit parameters) is variable. I made this code ...
scavi's user avatar
  • 57
1 vote
3 answers
6k views

I have time varying data trace which I want to fit a function to. The inputs to the functions are lists and I want the curve_fit to optimize all values in the list to fit the curve. I have gotten so ...
codingtoddler's user avatar
5 votes
1 answer
2k views

First question: I'm trying to fit experimental datas with function of the following form: f(x) = m_o*(1-exp(-t_o*x)) + ... + m_j*(1-exp(-t_j*x)) Currently, I don't find a way to have an undetermined ...
youyou's user avatar
  • 173
1 vote
1 answer
2k views

The signal I want to fit is a superposition of multiple sine-functions (and noise) and I want to fit for all frequencies simultaneously. Here an example data file, generated with two frequencies of ...
Felix's user avatar
  • 23
1 vote
0 answers
574 views

Assuming we have the below function to optimize for 4 parameters, we have to write the function as below, but if we want the same function with more number of parameters, we have to rewrite the ...
Alejandro's user avatar
  • 979
1 vote
1 answer
431 views

I am trying to use either scipy.curve_fit or scipy.least_squares for a function like def f(x, C): r = 0 for i in range( len(C) ) : for j in range( len(C[i]) ): r+= x[0]**j * ...
Bagnarol's user avatar
  • 135
1 vote
0 answers
181 views

I want to fit a data with sum of exponentials. The problem is the number of the exponentials is not constant. def func(t, a, taus): # plus more exponential functions return sum(a*np.exp(-t*taus))...
Nas's user avatar
  • 11
0 votes
1 answer
26 views

I noticed that the following questions were related: Variable Parameters Curve Fit 0, Variable Parameters Curve Fit 1, Hold Parameter Curve Fit 0. It creates an array of guess parameters and array ...
Scott Ellis's user avatar