From ff3e479f9fc0258a5d3978323cc04ef5532f8313 Mon Sep 17 00:00:00 2001 From: Nick Smith Date: Mon, 28 Jan 2019 22:41:14 -0600 Subject: [PATCH] Some more notes on stat uncertainty --- fnal_column_analysis_tools/hist/plot.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/fnal_column_analysis_tools/hist/plot.py b/fnal_column_analysis_tools/hist/plot.py index d3f99e43e..698b6b9c1 100644 --- a/fnal_column_analysis_tools/hist/plot.py +++ b/fnal_column_analysis_tools/hist/plot.py @@ -17,11 +17,14 @@ def poisson_interval(sumw, sumw2, sigma=1): """ - The so-called 'exact' interval - c.f. http://ms.mcmaster.ca/peter/s743/poissonalpha.html + The so-called 'Garwood' interval + c.f. https://www.ine.pt/revstat/pdf/rs120203.pdf + or http://ms.mcmaster.ca/peter/s743/poissonalpha.html For weighted data, approximate the observed count by sumw**2/sumw2 - When a bin is zero, find the scale of the nearest nonzero bin - If all bins zero, raise warning and set interval to sumw + This choice effectively scales the unweighted poisson interval by the average weight + Maybe not the best... see https://arxiv.org/pdf/1309.1287.pdf for a proper treatment + When a bin is zero, find the scale of the nearest nonzero bin + If all bins zero, raise warning and set interval to sumw """ scale = np.empty_like(sumw) scale[sumw!=0] = sumw2[sumw!=0] / sumw[sumw!=0]