spey.hypothesis_testing.utils.pvalues

Contents

spey.hypothesis_testing.utils.pvalues#

spey.hypothesis_testing.utils.pvalues(delta_test_statistic: float, sig_plus_bkg_distribution: AsymptoticTestStatisticsDistribution | EmpricTestStatisticsDistribution, bkg_only_distribution: AsymptoticTestStatisticsDistribution | EmpricTestStatisticsDistribution) Tuple[float, float, float][source]#

Calculate the p-values for the observed test statistic under the signal + background and background-only model hypotheses.

\[\begin{split}p_{s+b}&=& \int_{-\infty}^{-\sqrt{q_{\mu,A}} - \Delta q_\mu} \mathcal{N}(x| 0, 1) dx \\ p_{b}&=& \int_{-\infty}^{-\Delta q_\mu} \mathcal{N}(x| 0, 1) dx \\ p_{s} &=& p_{s+b}/ p_{b}\end{split}\]

where \(q_\mu\) stands for the test statistic and A stands for Assimov.

Parameters:
  • delta_test_statistic (float) – \(\Delta q_\mu\)

  • sig_plus_bkg_distribution (AsymptoticTestStatisticsDistribution) – the distribution for the signal + background hypothesis.

  • bkg_only_distribution (AsymptoticTestStatisticsDistribution) – The distribution for the background-only hypothesis.

Returns:

The p-values for the test statistic corresponding to the \(CL_{s+b}\), \(CL_{b}\), and \(CL_{s}\).

Return type:

Tuple[float, float, float]