JeschkeLab / DeerLab

Python package for data analysis for dipolar EPR spectroscopy
https://jeschkelab.github.io/DeerLab
MIT License
14 stars 10 forks source link

Deerlab cost value different to scipy verbose output #450

Closed HKaras closed 1 year ago

HKaras commented 1 year ago

The cost function returned to the user in the FitResult function is different to the one shown in the verbose output of the fit function. This verbose output comes direct from scipy.least_squares. This should be clearly documented as it is a source of confusion.

Screenshot 2023-08-17 at 10 44 21

HKaras commented 1 year ago

I do not understand the purpose of this line:

https://github.com/JeschkeLab/DeerLab/blob/4dcdcc221edc41f39f1ae91ae3dd341c0c55d772/deerlab/solvers.py#L761

This definition of fvals/cost is very different to scipy and is the main cause of the issue. Otherwise the descripency is a factor of 2.