Skip to content
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

support sum(w) < 0 in binned fits #1022

Merged
merged 12 commits into from
Aug 22, 2024
Merged

support sum(w) < 0 in binned fits #1022

merged 12 commits into from
Aug 22, 2024

Conversation

HDembinski
Copy link
Member

@HDembinski HDembinski commented Aug 15, 2024

This patch makes it possible to fit histograms with negative bin entries with ExtendedBinnedNLL and BinnedNLL. 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 than ExtendedBinnedNLL in application to weighted histograms.

Other changes:

  • Automatic notebook stripping is implemented via pre-commit; so notebooks that run for a long time are not stripped
  • Switch to SVG plots in notebooks

@HDembinski HDembinski force-pushed the negative_sum_of_weights branch from 22787da to 565fcc0 Compare August 21, 2024 16:02
@HDembinski HDembinski merged commit 2436bef into develop Aug 22, 2024
9 checks passed
@HDembinski HDembinski deleted the negative_sum_of_weights branch August 22, 2024 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant