|
[Rivet] Rivet "collaboration meeting"?Andy Buckley andy.buckley at cern.chTue May 21 20:23:15 BST 2013
On 21/05/13 21:01, Leif Lönnblad wrote: > On 2013-05-21 16:50, Frank Siegert wrote: >> Why is this not using the normal variance a la >> s^2 = 1/(n-1) <(w-<w>)^2> >> = 1/(n-1) (<w^2> - <w>^2) >> = 1/(n-1) (sum(w^2)/n - sum(w)^2/n^2) > > If we use this, the error will be zero for uniform weights... Yes, this would be a measure of the width of the distribution of weights. > For uniform weights, the number of entries in a bin is typically given > by a Poissonian distribution , which means that the variance is the same > as the mean, so the error on the number of entries is given by > sqrt(number of entries). > > For weighted events, one way of thinking is the following: Imagine there > is a discrete set of weights w_i. For each of these there are n_i > entries giving the error w_i*sqrt(n_i) for the sum of weight, n_i*w_i. > The total height of the histogram is sum_i(n_i*w_i), and the error in > that number is the square root of the sum of the squared errors for each > w_i: sqrt(sum_i(n_i*w_i^2)). This generalizes to the error > sqrt(sum(w^2)) for the bin height sum(w). Exactly. But with "height" replaced by "area" when the bin widths need to be accounted for to converge to the physical distribution. > Of course, this "derivation" only holds for a large number of entries in > a large number of bins, but it gives a reasonable error estimate also > for a few entries per bin. But maybe there is a better estimate out > there... If there is, I'd like to know. Hardly a proof of correctness, but ROOT uses sqrt(sum(w^2)) too... well, it does if you explicitly tell it to before starting to fill: "If Sumw2 has been called, the error per bin is computed as the sqrt(sum of squares of weights), otherwise the error is set equal to the sqrt(bin content)." from http://root.cern.ch/root/html/TH1.html Where was this causing a problem, Frank/David? Andy -- Dr Andy Buckley, Royal Society University Research Fellow Particle Physics Expt Group, University of Edinburgh / PH Dept, CERN
More information about the Rivet mailing list |