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 thespey
environment.get_backend()
function automatically wraps the backend withstatistical_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
, defaultnan
): 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
, default1000
): Number of toy samples for hypothesis testing. (Only used for toy-based hypothesis testing)
- ntoys (
other keyword arguments: Backend specific keyword inputs.
- Return type:
Callable[[Any], StatisticalModel]