pull¶
-
hep_spt.
pull
(vals, err, ref, ref_err=None)[source]¶ Get the pull with the associated errors for a given set of values and a reference. Considering, \(v\) as the experimental value and \(r\) as the rerference, the definition of this quantity is \((v - r)/\sigma\) in case symmetric errors are provided. In the case of asymmetric errors the definition is:
\[\text{pull} = \Biggl \lbrace { \frac{v - r}{\sigma_{low}} \text{ if } v - r \geq 0 \atop \frac{v - r}{\sigma_{up}} \text{ otherwise } }\]In the latter case, the errors are computed in such a way that the closer to the reference is equal to 1 and the other is scaled accordingly, so if \(v - r > 0\), then \(\sigma^{pull}_{low} = 1\) and \(\sigma^{pull}_{up} = \sigma_{up}/\sigma_{low}\).
If uncertainties are also provided for the reference, then the definition is the same but considering the sum of squares rule:
\[(\sigma'^{v}_{low})^2 = (\sigma^{v}_{low})^2 + (\sigma^{r}_{up})^2\]\[(\sigma'^{v}_{up})^2 = (\sigma^{v}_{up})^2 + (\sigma^{r}_{low})^2\]- Parameters
vals (numpy.ndarray) – values to compare with.
err (numpy.ndarray) – array of errors. Both symmetric and asymmetric errors can be provided. In the latter case, they must be provided as a (2, n) array.
ref (numpy.ndarray) – reference to follow.
ref_err (numpy.ndarray) – possible errors for the reference.
- Returns
Pull of the values with respect to the reference and associated errors. In case asymmetric errors have been provided, the returning array has shape (2, n).
- Return type
- Raises
TypeError – if any of the error arrays does not have shape (2, n) or (n,).
See also