spey.hypothesis_testing.test_statistics.get_test_statistic

spey.hypothesis_testing.test_statistics.get_test_statistic#

spey.hypothesis_testing.test_statistics.get_test_statistic(test_stat: str) Callable[[float, float, float, Callable[[float], float]], float][source]#

Retreive the test statistic function

Parameters:

test_stat (Text) –

test statistic.

  • 'qtilde': (default) performs the calculation using the alternative test statistic, \(\tilde{q}_{\mu}\), see eq. (62) of [arXiv:1007.1727] (qmu_tilde()).

    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.

  • 'q': performs the calculation using the test statistic \(q_{\mu}\), see eq. (54) of [arXiv:1007.1727] (qmu()).

  • 'q0': performs the calculation using the discovery test statistic, see eq. (47) of [arXiv:1007.1727] \(q_{0}\) (q0()).

Raises:

UnknownTestStatistics – If the test_stat input does not match any of the above.

Returns:

returns the function to compute test statistic

Return type:

Callable[[float, float, float, Callable[[float], float]], float]