spey.statistical_model_wrapper

spey.statistical_model_wrapper#

spey.statistical_model_wrapper(func: BackendBase) Callable[[Any], StatisticalModel][source]#

Backend wrapper for StatisticalModel. This function allows a universal integration of each backend to the spey environment. get_backend() function automatically wraps the backend with statistical_model_wrapper() before returning the object.

Parameters:

func (BackendBase) – Desired backend to be used for statistical analysis.

Raises:

AssertionError – If the input function does not inherit BackendBase

Returns:

Wrapper that takes the following inputs

  • args: Backend specific arguments.

  • analysis (Text, default "__unknown_analysis__"): Unique identifier of the statistical model. This attribue will be used for book keeping purposes.

  • xsection (float, default nan): cross section, unit is determined by the user. Cross section value is only used for computing upper limit on excluded cross-section value.

  • ntoys (int, default 1000): Number of toy samples for hypothesis testing.

    (Only used for toy-based hypothesis testing)

  • other keyword arguments: Backend specific keyword inputs.

Return type:

Callable[[Any], StatisticalModel]