fix: per-channel yield uncertainty contribution from staterror-staterror terms #324
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.
The
model_utils.yield_stdev
implementation contained an optimization forstaterror
-staterror
cross terms, which have no contribution when calculating per-bin uncertainties:cabinetry/src/cabinetry/model_utils.py
Lines 303 to 307 in f34c73a
When the functionality to calculate per-channel uncertainties was added in #189, the optimization should have been updated, since these cross terms no longer cancel out for the per-channel calculation. This now fixes the bug in per-channel yield uncertainties by removing this performance optimization completely.
While this does make the calculation slower overall, that is not a concern since it will be replaced completely by #316 afterwards, resulting in a significant speed-up. This intermediate fix is just meant to split the development up into steps that are hopefully easier to follow when looking back at this in the future.
resolves #323