spey.hypothesis_testing.test_statistics.q0#
- spey.hypothesis_testing.test_statistics.q0(mu: float, muhat: float, max_logpdf: float, logpdf: Callable[[float], float]) float [source]#
Discovery test statistics, \(q_{0}\) see eq. (47) of [arXiv:1007.1727].
\[\begin{split}q_0 = \begin{cases} 0 & \text{if}\ \hat{\mu} < 0\ ,\\ -2\log\left( \frac{\mathcal{L}(0, \theta_0)}{\mathcal{L}(\hat{\mu}, \hat{\theta})} \right) & \text{otherwise} \end{cases}\end{split}\]- Parameters:
mu (
float
) –parameter of interest, \(\mu\).
Note
mu
argument is overwritten by zero. This input is only for consistency with other test statistic functions.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 \(q_{0}\).
- Return type:
float