I am trying to reproduce a known fitting result (reported in a journal paper): applying a power-law model to data. As can be seen in the plot-A below, I was able to reproduce the result by using known best-fit parameters.
< Plot-A: the known result from the literature >
However, I could not re-derive the best-fit parameters by myself.
< Plot-B: an incorrect fit from curve_fit and lmfit >
The case-A returns,
OptimizeWarning: Covariance of the parameters could not be estimated
(if I omit several initial data points, the fit returns some results which are not bad, but still different from the known best-fit result).
EDIT: now, i just found new additional error messages this time.. :
(1) RuntimeWarning: overflow encountered in power
(2) RuntimeWarning: invalid value encountered in power
The case-B (with initial guess more closer to the best-fit parameters) returns,
RuntimeError: Optimal parameters not found: Number of calls to function has reached maxfev = 5000.
If I set the maxfev to be much higher to take account of this error message, the fit works but returns an incorrect result (very wrong fit compared to the best-fit result).