Repository navigation
[RF] Compute global correlations of external covariance matrices lazily - #23875
Merged
Merged
Conversation
Since bd0a3eb, RooFitResult::setCovarianceMatrix() inverted the correlation matrix right away to derive the global correlation coefficients, and warned when the matrix was singular. This produced spurious warnings in xRooFit, which legitimately builds placeholder covariance matrices for parameter snapshots: a diagonal matrix with the current parameter errors, which is singular as soon as one parameter has no error, as is the usual pre-fit state when drawing from a workspace. The coefficients are derived data that nothing consumes unless the user asks for them, so there is no reason to pay for the inversion, or to complain about it, at the time the matrix is set. Move the computation into a new RooFitResult::fillGlobalCorr() helper that runs on demand from the globalCorr() accessors, printMultiline() and isIdentical(). For a singular matrix the coefficients are set to zero and the warning is emitted once, at the point where they are actually requested. The _GC member becomes mutable so the const accessors can fill it. 🤖 Done with the help of AI
Test Results 24 files 24 suites 3d 21h 34m 0s ⏱️ Results for commit 61683ab. |
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.
Since bd0a3eb, RooFitResult::setCovarianceMatrix() inverted the correlation matrix right away to derive the global correlation coefficients, and warned when the matrix was singular. This produced spurious warnings in xRooFit, which legitimately builds placeholder covariance matrices for parameter snapshots: a diagonal matrix with the current parameter errors, which is singular as soon as one parameter has no error, as is the usual pre-fit state when drawing from a workspace. The coefficients are derived data that nothing consumes unless the user asks for them, so there is no reason to pay for the inversion, or to complain about it, at the time the matrix is set.
Move the computation into a new RooFitResult::fillGlobalCorr() helper that runs on demand from the globalCorr() accessors, printMultiline() and isIdentical(). For a singular matrix the coefficients are set to zero and the warning is emitted once, at the point where they are actually requested. The _GC member becomes mutable so the const accessors can fill it.
🤖 Done with the help of AI
FYI @TomasDado, this should silence the harmless errors when using xRooFit