levenberg-marquardt icon indicating copy to clipboard operation
levenberg-marquardt copied to clipboard

Feature request: Returning covariance matrix and parameter error

Open Ameyanagi opened this issue 1 year ago • 0 comments

Thanks for developing a very nice crate! Can a feature be added to return a Covariance matrix of parameters (covar) and 1σ uncertainties on params(perror)? I am working in the scientific field, which requires an error bound to be calculated for the fits, and this feature will help the field so much.

The original MINPACK returns a result of final QR decomposition, which enables the calculation of the covariance matrix. The pwkit(https://github.com/pkgw/pwkit/blob/master/pwkit/lmmin.py) provides perror and covar as a result. The lmfit(https://jugit.fz-juelich.de/mlz/lmfit/-/blob/main/lib/lmfit.hpp) also return the parameters as parerr and covar.

Ameyanagi avatar Sep 10 '23 05:09 Ameyanagi