All other arguments are the parameters to be fit. The first argument must be the input data. The function we are passing should have a certain structure. All we had to do was call _fit and pass it the function we want to fit, the x data and the y data. We get 30.60 for fit_tau and 245.03 for fit_init both very close to the real values of 30 and 250. Our fit parameters are almost identical to the actual parameters. # Sample exp_decay with optimized parametersĪx.set_title("Curve Fit Exponential Decay") # Use _fit to fit parameters to noisy data Noise=np.random.normal(scale=50, size=x.shape) # Sample exp_decay function and add noise
0 Comments
Leave a Reply. |