Skip to content

feat: propagate bin variances for independent histogram ratios - #767

Open
bingdongni wants to merge 1 commit into
scikit-hep:mainfrom
bingdongni:feature/propagate-weighted-ratio-errors
Open

bingdongni wants to merge 1 commit into
scikit-hep:mainfrom
bingdongni:feature/propagate-weighted-ratio-errors

Conversation

@bingdongni

Copy link
Copy Markdown

Closes #463. For a ratio of independent weighted samples, the bin contents alone cannot determine the uncertainty: positive and negative weights can even sum to zero in a bin with substantial variance.

Hist.plot_ratio(other, rp_uncertainty_type="propagate") uses the stored bin variances of both histograms for first-order error propagation. The same option is available to array callers via hist.intervals.ratio_uncertainty. The existing Poisson and efficiency modes keep their counting assumptions. A zero denominator produces an undefined ratio, while a zero numerator with finite uncertainty remains visible.

The Linux tests check the interval calculation for signed sums and inspect the actual Matplotlib error bars from two filled Weight histograms.

This branch has not been deployed

No deployments
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.

[FEATURE] plot_ratio() to support Weighted histograms

1 participant