Skip to content

Commit

Permalink
improve code efficiency
Browse files Browse the repository at this point in the history
  • Loading branch information
jackaraz committed Dec 10, 2024
1 parent a5c4f27 commit 524e1ce
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/spey_pyhf/simplify.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,11 @@ def __call__(
third_moment=third_moments,
)
elif convert_to == "default_pdf.effective_sigma":
# Get 68% quantiles
q = (1.0 - (norm.cdf(1.0) - norm.cdf(-1.0))) / 2.0
absolute_uncertainty_envelops = list(
zip(np.quantile(samples, q, axis=0), np.quantile(samples, 1 - q, axis=0))
absolute_uncertainty_envelops = np.stack(
[np.quantile(samples, q, axis=0), np.quantile(samples, 1 - q, axis=0)],
axis=1,
)
save_kwargs.update(
{"absolute_uncertainty_envelops": absolute_uncertainty_envelops}
Expand Down

0 comments on commit 524e1ce

Please sign in to comment.