Data classes#
- class spey_pyhf.data.Base[source]#
Base class for pyhf data input
- abstractmethod config(allow_negative_signal: bool = True, poi_upper_bound: float | None = None) ModelConfig[source]#
Model configuration.
- Parameters:
allow_negative_signal (
bool, defaultTrue) – IfTrue\(\hat\mu\) value will be allowed to be negative.poi_upper_bound (
float, default40.0) – upper bound for parameter of interest, \(\mu\).
- Returns:
Model configuration. Information regarding the position of POI in parameter list, suggested input and bounds.
- Return type:
ModelConfig
- abstract property isAlive: bool#
Returns True if at least one bin has non-zero signal yield.
- class spey_pyhf.data.FullStatisticalModelData(signal_patch: List[Dict], background_only_model: Dict | str)[source]#
Bases:
BaseData container for the full statistical model.
- Parameters:
signal_patch (
List[Dict]) – Patch data for signal model. please see this link for details on the structure of the input.background_only_model (
DictorText) – This input expects background only data that describes the full statistical model for the background. It also acceptsstrinput which indicates the full path to the background onlyJSONfile.
- background_only_model: Dict | str#
- property channel_properties: Iterator[Tuple[int, str, int]]#
Returns an iterator for channel index, name and number of bins
- property channels: Iterator[str]#
Return channel names
- config(allow_negative_signal: bool = True, poi_upper_bound: float | None = None) ModelConfig[source]#
Model configuration.
- Parameters:
allow_negative_signal (
bool, defaultTrue) – IfTrue\(\hat\mu\) value will be allowed to be negative.poi_upper_bound (
float, default40.0) – upper bound for parameter of interest, \(\mu\).
- Returns:
Model configuration. Information regarding the position of POI in parameter list, suggested input and bounds.
- Return type:
ModelConfig
- property isAlive: bool#
Returns True if at least one bin has non-zero signal yield.
- signal_patch: List[Dict]#
- class spey_pyhf.data.SimpleModelData(signal_yields: List[float], background_yields: List[float], data: List[float], absolute_uncertainties: List[float])[source]#
Bases:
BaseDataclass for simple statistical model
- Parameters:
signal_yields (
List[float]) – signal yieldsbackground_yields (
List[float]) – background yieldsdata (
List[float]) – observationsabsolute_uncertainties (
List[float]) – absolute uncertainties on the background
- absolute_uncertainties: List[float]#
- background_yields: List[float]#
- config(allow_negative_signal: bool = True, poi_upper_bound: float | None = None) ModelConfig[source]#
Model configuration.
- Parameters:
allow_negative_signal (
bool, defaultTrue) – IfTrue\(\hat\mu\) value will be allowed to be negative.poi_upper_bound (
float, default40.0) – upper bound for parameter of interest, \(\mu\).
- Returns:
Model configuration. Information regarding the position of POI in parameter list, suggested input and bounds.
- Return type:
ModelConfig
- data: List[float]#
- property isAlive: bool#
Returns True if at least one bin has non-zero signal yield.
- signal_yields: List[float]#