-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update confidence.rst #942
Conversation
Hello! I found a bug in an example with calculating c.i. The assessment of sigma's and related plotting of confidence intervals performed with sqrt(chi2/redchi), however, it should be sqrt((chi2-chi2.min)/redchi). The updated equation provides accurate and adequate contour plots for parameter uncertainties.
@skoldobskiy Ah, good catch. We do that subtraction with So, I'm +1 on this change. I'll leave this open for a couple of days in case there are any objections or other considerations. But, I hope to merge this and #941 and then be ready to push a release soonish. |
@newville Also I propose that the doc [https://lmfit.github.io/lmfit-py/confidence.html#lmfit.conf_interval2d] can be changed in a way to emphasize that |
@skoldobskiy If you have wording there that you want to change, are you willing to include that in this PR? I would say "please do!" |
|
@skoldobskiy it looks like there are some RST formatting issues - like single quotes where you might want double backticks. Have you installed and run "pre-commit"? That might help identify those issues. |
doc/confidence.rst
Outdated
# you could calculate the matrix of probabilities from sigma as: | ||
# prob_mat = np.erf(sigma_mat/np.sqrt(2)) | ||
if explicitly_calculate_sigma: | ||
print("Generating chi-square map for ", pairs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use a formatting string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@newville @reneeotten Ok thanks, I'll check and fix it.
@skoldobskiy Thanks -- this looks okay to me. @reneeotten any objection from anyone to Squash+Merge? If I don't hear otherwise, I will plan to do that on Monday. |
@skoldobskiy @reneeotten Thanks! |
Hello!
I found a bug in an example with calculating c.i.
The assessment of sigma's and related plotting of confidence intervals performed with sqrt(chi2/redchi), however, it should be sqrt((chi2-chi2.min)/redchi). The updated equation provides accurate and adequate contour plots for parameter uncertainties.
Also renaming dchi2 to chi2 can be considered.
Description
https://lmfit.github.io/lmfit-py/confidence.html#lmfit.conf_interval2d -- no ellipses are plotted here, however, they should. The proposed change corrects this.
no noType of Changes
Tested on
Verification
Have you