PyDDM.ddm_calc.execute_LSQ_fit

PyDDM.ddm_calc.execute_LSQ_fit

execute_LSQ_fit(dData, times, param_dict, debug=True)

Performs least_squares fit.

Using the scipy.optimize.least_squares function, the data is fit to model specified within the parameter param_dict. 1

Parameters
  • dData (array) – Array containing the DDM data to fit for. This will be either the DDM matrix or the ISF. This should be a 2D array; the first dimension corresponds to the lag times, the second dimension corresponds to the wavevectors.

  • times (array_like) – 1D array of the lagtimes

  • param_dict (dict) – Dictionary corresponding to the model we will fit to. This dictionary contains the parameters, the initial guess for their values, their bounds, and the function of the model to fit to. See the module PyDDM.fit_parameters_dictionaries

  • debug ({True}, optional) – If True, will print out values of initial guesses and bounds (and other info).

Returns

  • lsqr_params (array) – Values found for the parameters.

  • theory (array) – Model evaluated using values of the best fit parameters.

  • fun (array) – Vector of residuals

References

1

https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.least_squares.html