spey.hypothesis_testing.test_statistics.qmu#
- spey.hypothesis_testing.test_statistics.qmu(mu: float, muhat: float, max_logpdf: float, logpdf: Callable[[float], float]) float [source]#
Test statistic \(q_{\mu}\), see eq. (54) of [arXiv:1007.1727]
\[\begin{split}q_{\mu} = \begin{cases} 0 & \text{if}\ \hat{\mu} > \mu\ ,\\ -2\log\left( \frac{\mathcal{L}(\mu, \theta_\mu)}{\mathcal{L}(\hat{\mu}, \hat{\theta})} \right) & \text{otherwise} \end{cases}\end{split}\]- 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 \(q_{\mu}\).
- Return type:
float