Repository navigation
ADR Suggestion Fitting weights
#135
Replies: 3 comments 3 replies
|
This needs to be converted to ADR |
|
I would furthermore like to discuss a better naming scheme than "weights", or at least making it very clear what we mean by it. The bug mentioned in #204 is caused by me assuming "weight" meant the same in lmfit and Bumps. I am personally a fan of passing either |
|
Bumps and LMfit right now don't agree. This is because Bumps assumes that the weights it receives (called We should fix this so LMFit gives the same result as Bumps. We should also make it more clear what we are doing. I therefore again propose that instead of asking for Here's a script that illustrates the issue (Generated by Claude, comments by me) Output: The analytical result matches Bumps but not LMFit. We should also consider if we want to add chi_red^2 rescaling as an option for users if their chi_red^2 is large. |
Uh oh!
There was an error while loading. Please reload this page.
General
When fitting data to a model it is possible to add weights to different data-points to prioritize the fit to certain parts of the data which might be more important or more accurate than other parts. This is especially useful when working with data with uncertainties, as it is possible to weigh more accurate data-points higher than more inaccurate points.
Current Implementation
Currently, if the user does not provide a list of weights to the fitter, a list of default weights will be used, according to:
i.e. the weights are set to the square-root of the data values y. This is an issue for 2 reasons:
Inf/NaNerrors.Proposed implementation
Based on the discussion of this issue in #133, we propose to completely remove default weights from the core
EasySciencelibrary and require users to provide a list of weights explicitly whenever making a fit. We additionally propose to add a check on this input to ensure that the user doesn't accidentally add weights with 0-values orNaNs/Infs to increase robustness.Sub-projects can then implement their own defaults depending on the technique of the relevant project.
All reactions