support sum(w) < 0 in binned fits #1022
Merged
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.
This patch makes it possible to fit histograms with negative bin entries with
ExtendedBinnedNLL
andBinnedNLL
. These occur, for example, when sweighted samples are histogrammed. This patch implements an extension of the Bohm-Zech approach for this case. The ideas behind this extension are compiled in a write-up that can be found in the documentation under "Studies: Fitting weighted histograms".The PR also fixes a mistake in
BinnedNLL
, which used the wrong cost function for weighted histograms, for ordinary histograms there is no change. This is a side result from thinking deeply about fitting weighted histograms. The old cost function lead to biased estimates, while the new one is now almost unbiased and performs even better thanExtendedBinnedNLL
in application to weighted histograms.Other changes: