scikit-hep / hist

Histogramming for analysis powered by boost-histogram

Home Page:https://hist.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Get uncertainties from Hist obejct

anjabeck opened this issue · comments

I would like to plot the residuals between a histogram and a function and could not find a (simple) way to get the uncertainties of the histogram.

I think this functionality is available in poisson_interval where poisson_interval(H.values()) returns the Poissonian uncertainties for the counts in Hist H if I understand correctly.

However it would be useful to have a method implemented for the Hist object that returns this uncertainty directly, something like

H.uncertainties(uncertainty_type="poisson")

And it would be particularly nice if a similarly simple syntax could return uncertainties for the density values returned by H.density().

EDIT: I found the variances() method which seems to return the uncertainties. It would be very useful if the words "uncertainty" or "error" appeared at least once in the documentation in relation to this method.

Improving the docs here would be great! A small discussion of how to compute different quantities of interest would be ideal. :)