spey.hypothesis_testing.test_statistics.qmu_tilde

Contents

spey.hypothesis_testing.test_statistics.qmu_tilde#

spey.hypothesis_testing.test_statistics.qmu_tilde(mu: float, muhat: float, max_logpdf: float, logpdf: Callable[[float], float]) float[source]#

Alternative test statistics, \(\tilde{q}_{\mu}\), see eq. (62) of [arXiv:1007.1727].

\[\begin{split}\tilde{q}_{\mu} = \begin{cases} 0 & \text{if}\ \hat{\mu} > \mu\ , \\ -2\log\left( \frac{\mathcal{L}(\mu, \theta_\mu)}{\mathcal{L}(\max(\hat{\mu}, 0), \hat{\theta})} \right) & \text{otherwise} \end{cases}\end{split}\]

Warning

Note that this assumes that \(\hat\mu\geq0\), hence allow_negative_signal assumed to be False. If this function has been executed by user, spey assumes that this is taken care of throughout the external code consistently. Whilst computing p-values or upper limit on \(\mu\) through spey this is taken care of automatically in the backend.

Parameters:
  • mu (float) – parameter of interest, \(\mu\).

  • muhat (float) – \(\hat\mu\) value that maximizes the likelihood.

  • max_logpdf (float) – maximum value of \(\log\mathcal{L}\).

  • logpdf (Callable[[float], float]) – \(\log\mathcal{L}(\mu, \theta_\mu)\).

Returns:

the value of \(\tilde{q}_{\mu}\).

Return type:

float