Replies: 1 comment
-
|
I started a PR for this at #888. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've been working on some analyses, where I'm fitting data with a background and two peaks, not unlike the NistGauss2 example. Once the fits were done, I wanted to calculate the centroid and total area of the two "non-background" peaks and the uncertainties in these values. The peaks overlap, so the amplitudes of the two peaks are highly correlated. That means that adding the uncertainties for the amplitudes in quadrature greatly overestimates the uncertainty in the total area (by like 5x as it turns out).
If I define derived parameters of 'centroid' and 'amp_sum' for these, for example adding to that example:
which will then give good values for uncertainties in
centroidandarea.But: it would be nice to do this after the fit. In fact, a one-line change in
Minimzer.py(around line 870)would give a dict
result.uparswith each value being the correlated 'uncertainties uvar'. That would allow such derived quantities could be found after the fact withand without having to actually add them to Parameters before the fit is done. I propose we add this. Any objections to that?
And also: We could change many of the derived values like "fwhm" and "height" for the built-in models to be calculated after the fact. That would mean they are not calculated at each iteration. There have been a few concerns about the overhead of these calculations, and we do not use them at each iteration.
We could do this either by adding a
post_fitmethod to Model that each sub-class can overwrite to put these values into theresults.paramsimmediately after the fit is done.Or we could add a flag to Parameter to indicate that constraint expressions are "post fit, derived values".
Or, we could leave it as is.
At this point, I think the
post_fitmethod might be the cleanest and most flexible, but I could be persuaded otherwise.Any preferences on this part?
Beta Was this translation helpful? Give feedback.
All reactions