spey.hypothesis_testing.upper_limits.find_poi_upper_limit

spey.hypothesis_testing.upper_limits.find_poi_upper_limit#

spey.hypothesis_testing.upper_limits.find_poi_upper_limit(maximum_likelihood: Tuple[float, float], logpdf: Callable[[float], float], maximum_asimov_likelihood: Tuple[float, float], asimov_logpdf: Callable[[float], float], expected: ExpectationType, confidence_level: float = 0.95, allow_negative_signal: bool = True, low_init: float = 1.0, hig_init: float = 1.0, expected_pvalue: Literal['nominal', '1sigma', '2sigma'] = 'nominal', maxiter: int = 10000) float | List[float][source]#

Find upper limit for parameter of interest, \(\mu\)

Parameters:
  • maximum_likelihood (Tuple[float, float]) – Tuple including \(\hat\mu\) and minimum negative log-likelihood.

  • logpdf (Callable[[float], float]) – log-likelihood as function of POI, \(\log\mathcal{L}(\mu)\)

  • maximum_asimov_likelihood (Tuple[float, float]) – Tuple including \(\hat\mu_A\) and minimum negative log-likelihood for Asimov data.

  • asimov_logpdf (Callable[[float], float]) – log-likelihood as function of POI, \(\log\mathcal{L}_A(\mu)\) for Asimov data.

  • expected (ExpectationType) –

    Sets which values the fitting algorithm should focus and p-values to be computed.

    • observed: Computes the p-values with via post-fit prescriotion which means that the experimental data will be assumed to be the truth

    • aposteriori: Computes the expected p-values with via post-fit prescriotion which means that the experimental data will be assumed to be the truth.

    • apriori: Computes the expected p-values with via pre-fit prescription which means that the SM will be assumed to be the truth.

  • confidence_level (float, default 0.95) – Determines the confidence level of the upper limit i.e. the value of \(1-CL_s\). It needs to be between [0,1].

  • allow_negative_signal (bool, default True) – _description_

  • low_init (float, default None) – Lower limit for the search algorithm to start

  • hig_init (float, default None) – Upper limit for the search algorithm to start

  • expected_pvalue (Text, default "nominal") –

    In case of aposteriori and apriori expectation, gives the choice to find excluded upper limit for statistical deviations as well.

    • "nominal": only find the upper limit for the central p-value. Returns a single value.

    • "1sigma": find the upper limit for central p-value and \(1\sigma\) fluctuation from background. Returns 3 values.

    • "2sigma": find the upper limit for central p-value and \(1\sigma\) and \(2\sigma\) fluctuation from background. Returns 5 values.

      Note

      For expected=spey.ExpectationType.observed, expected_pvalue argument will be overwritten to "nominal".

  • maxiter (int, default 10000) – Maximum iteration limit for the optimiser.

Returns:

In case of nominal values it returns a single value for the upper limit. In case of expected_pvalue="1sigma" or expected_pvalue="2sigma" it will return a list of multiple upper limit values for fluctuations as well as the central value. The output order is \(-2\sigma\) value, \(-1\sigma\) value, central value, \(1\sigma\) and \(2\sigma\) value.

Return type:

Union[float, List[float]]