Repository navigation
Conversation
HasHessian() of the fit method functions also returned true for fits where the full Hessian is never computed: binned fits with the model integrated over the bins, and unbinned likelihood fits. Minuit2 then got an all-zero Hessian, and the parameter errors of gradient fits were wrong. For example, TH1::Fit(f, "G I") with a TF1 for which clad generates the Hessian gave an error of 2 for all parameters, without any warning. Return false in HasHessian() for these fits, so that Minuit2 computes the second derivatives numerically. Also check the result of DataElement() in FitMethodFunction::Hessian() with std::isnan. It was compared to NaN with ==, which is never true, so a failure to compute the Hessian was not reported. Add a test for each of the two changes.
Test Results 23 files 23 suites 3d 18h 0m 3s ⏱️ For more details on these failures, see this check. Results for commit a3f0d68. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HasHessian() of the fit method functions also returned true for fits where the full Hessian is never computed: binned fits with the model integrated over the bins, and unbinned likelihood fits. Minuit2 then got an all-zero Hessian, and the parameter errors of gradient fits were wrong, without any warning.
For example, fitting a histogram with a formula TF1 for which clad generates the Hessian:
Return false in HasHessian() for these fits, so that Minuit2 computes the second derivatives numerically. Also check the result of DataElement() in FitMethodFunction::Hessian() with
std::isnan. It was compared to NaN with==, which is never true, so a failure to compute the Hessian was not reported.Fits where the full Hessian is available, like "G" without "I", are not affected.
Related to #21622, which changes the same Hessian interfaces.
I used AI to help write the fix and tests. I reviewed and tested the changes and take responsibility for them.