Python API¶
Top-Level¶
NumPy backend for pyhf |
|
scipy.optimize-based Optimizer using finite differences. |
|
NumPy backend for pyhf |
|
scipy.optimize-based Optimizer using finite differences. |
|
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 |
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¶
PyTorch Optimizer Backend. |
|
scipy.optimize-based Optimizer using finite differences. |
|
Tensorflow Optimizer Backend. |
|
MINUIT Optimizer Backend. |
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¶
|
Compute \(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]. |
|
Twice the negative Log-Likelihood. |
|
Run a unconstrained maximum likelihood fit. |
|
Run a maximum likelihood fit with the POI value fixzed. |
|
Compute Asimov Dataset (expected yields at best-fit values) for a given POI value. |
|
Compute p-values from test-statistic values. |
|
Compute 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¶
|
|
|
|