Python API¶
Top-Level¶
NumPy backend for pyhf |
|
NumPy backend for pyhf |
|
Get the current backend and the associated optimizer |
|
|
Probability Distribution Functions (PDFs)¶
The Normal distribution with mean |
|
The Poisson distribution with rate parameter |
|
A probability density corresponding to the joint distribution of a batch of identically distributed random variables. |
|
A probability density corresponding to the joint distribution of multiple non-identical component distributions |
Making Models from PDFs¶
The main pyhf model class. |
|
A JSON-serializable object that is built from an object that follows the workspace.json schema. |
Backends¶
The computational backends that pyhf
provides interfacing for the vector-based calculations.
NumPy backend for pyhf |
|
PyTorch backend for pyhf |
|
TensorFlow backend for pyhf |
Optimizers¶
Modifiers¶
Interpolators¶
The piecewise-linear interpolation strategy. |
|
The piecewise-exponential interpolation strategy. |
|
The quadratic interpolation and linear extrapolation strategy. |
|
The polynomial interpolation and exponential extrapolation strategy. |
|
The piecewise-linear interpolation strategy, with polynomial at \(\left|a\right| < 1\) |
Inference¶
|
Computes \(p\)-values and test statistics for a single value of the parameter of interest |
|
The test statistic, \(q_{\mu}\), for establishing an upper limit on the strength parameter, \(\mu\), as defiend in Equation (14) in [1007.1727]. |
|
|
|
|
|
The \(p\)-values for signal strength \(\mu\) and Asimov strength \(\mu'\) as defined in Equations (59) and (57) of [1007.1727] |
|
Computes the expected \(p\)-values CLsb, CLb and CLs for data corresponding to a given percentile of the alternate hypothesis. |
Exceptions¶
Various exceptions, apart from standard python exceptions, that are raised from using the pyhf
API.
InvalidMeasurement is raised when a specified measurement is invalid given the specification. |
|
InvalidSpecification is raised when a specification does not validate against the given schema. |
|
InvalidWorkspaceOperation is raised when an operation on a workspace fails. |
|
InvalidModel is raised when a given model does not have the right configuration, even though it validates correctly against the schema. |
|
InvalidModifier is raised when an invalid modifier is requested. |
|
InvalidInterpCode is raised when an invalid/unimplemented interpolation code is requested. |
|
MissingLibraries is raised when something is imported by sustained an import error due to missing additional, non-default libraries. |
|
InvalidOptimizer is raised when trying to set an optimizer that does not exist. |
|
InvalidPdfParameters is raised when trying to evaluate a pdf with invalid parameters. |
|
InvalidPdfData is raised when trying to evaluate a pdf with invalid data. |
Utilities¶
|
|
|
|