I use the scipy.optimize.minimize
( https://docs.scipy.org/doc/scipy/reference/tutorial/optimize.html ) function with method=\'L-BFGS-B
.
An
It really depends what you mean by "errors". There is no general answer to your question, because it depends on what you're fitting and what assumptions you're making.
The easiest case is one of the most common: when the function you are minimizing is a negative log-likelihood. In that case the hessian matrix returned by the fit is the covariance describing the Gaussian approximation to the maximum likelihood, which is a standard way of estimating errors in maximization of a likelihood.
Beware that if you are fitting a different kind of function or are making different assumptions, then that doesn't apply.