Feb-17-2018, 01:47 PM
Hi evrybody,
i have a noisy signal df.measdata and want to fit a model function in my measurement data. the model function is a sinus, whoms frequency and amplitude can be adapted by the optimizer. i tried a lot already, but scipy.optimize is not working for me, res.x just returns very high numbers for the variables
cheers and regards
i have a noisy signal df.measdata and want to fit a model function in my measurement data. the model function is a sinus, whoms frequency and amplitude can be adapted by the optimizer. i tried a lot already, but scipy.optimize is not working for me, res.x just returns very high numbers for the variables
x0=[1,1] fun = lambda x: sum(x[0]*np.sin(x[1]*df.timestamp)-df.measdata) res = minimize(fun, x0, method='Nelder-Mead', tol=0.001) res.xcan anyone explain which mistake i make?
cheers and regards