What should be the Poisson interval of 0 event

This might be more of a stat question than related to ROOT. I know that the Poisson interval of 0 events is probably ill-defined, but in case we need to plot the data with error bars, we might sometimes need to show the error bar for bins with 0 events (alternatively we could just hide that data point).

From the RooHistError class, we get (lower, upper) interval of (0.0, 1.1478744644493182)

import ctypes
import ROOT
lower, upper = ctypes.c_double(), ctypes.c_double()
nevent = 0
nsigma = 1
HistError = ROOT.RooHistError.instance()
HistError.getPoissonInterval(nevent, lower, upper, nsigma)
print(lower.value, upper.value)

However, with the explicit formula from Poisson errors for RooHist - #8 by moneta, we get (lower, upper) interval of (0.0, 1.8410216450092634)

import ROOT
import numpy as np

nevent = 0
nsigma = 1
beta = ROOT.Math.erf(nsigma / np.sqrt(2.0))
alpha = (1 - beta)
lower = ROOT.Math.gamma_quantile(alpha / 2., nevent , 1.0)
upper = ROOT.Math.gamma_quantile_c(alpha / 2., nevent + 1, 1.0)
print(lower, upper)

So which one should be preferred? Or neither of them? What should be the expected behavior?

Regards,
Alkaid

Hi @AlkaidCheng, thanks for your question.

Let me ping @moneta and @jonas about this.
I’m a bit surprised that getPoissonInterval doesn’t give an error for n = 0, but they can probably explain why that’s the case.

If you want to plot the Poisson confidence interval for each bin, I think it is more appropriate to use the value you get in your second snipped of code, which gives the upper 2 side values (the probabilkty content from the upper value to + infinity is alpha/2). In this case the same procedure is used for every n.
In the first case the upper limit is reportes (the probability content from the given value to + infinity is alpha). This could be more realistic, but I think is not fully correct, to use a different procedure depending on the data you observe.

I hope this clarifies this issue

Lorenzo

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.