sw2_unc¶
-
hep_spt.
sw2_unc
(arr, bins=20, range=None, weights=None)[source]¶ Calculate the errors using the sum of squares of weights. The uncertainty is calculated as follows:
\[\sigma_i = \sqrt{\sum_{j = 0}^{n - 1} \omega_{i,j}^2}\]where i refers to the i-th bin and \(j \in [0, n)\) refers to each entry in that bin with weight \(\omega_{i,j}\). If “weights” is None, then this coincides with the square root of the number of entries in each bin.
- Parameters
arr – input array of data to process.
bins (int, sequence of scalars or str) – see
numpy.histogram()
.range (None or tuple(float, float)) – range to process in the input array.
weights (None or numpy.ndarray(value-type)) – possible weights for the histogram.
- Returns
Symmetric uncertainty.
- Return type
See also