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
Returns

Symmetric uncertainty.

Return type

numpy.ndarray