spey.hypothesis_testing.utils.expected_pvalues

spey.hypothesis_testing.utils.expected_pvalues#

spey.hypothesis_testing.utils.expected_pvalues(sig_plus_bkg_distribution: AsymptoticTestStatisticsDistribution | EmpricTestStatisticsDistribution, bkg_only_distribution: AsymptoticTestStatisticsDistribution | EmpricTestStatisticsDistribution) List[List][source]#

Calculate the \(p\) values corresponding to the median significance of variations of the signal strength from the background only hypothesis \(\mu=0\) at \((-2,-1,0,1,2)\sigma\).

\[\begin{split}p_{s+b}&=& \int_{-\infty}^{-\sqrt{q_{\mu,A}} - N\sigma} \mathcal{N}(x| 0, 1) dx \\ p_{b}&=& \int_{-\infty}^{-N\sigma} \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. \(N\sigma\in[-2,-1,0,1,2]\).

Parameters:
  • 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:

List[List]