Python API¶
Top-Level¶
Workspace for managing HS3 model specifications. |
|
Probabilistic model with compiled tensor operations. |
|
Convert a PyTensor expression into a JAX-callable |
|
A JAX-callable wrapper around a compiled PyTensor expression. |
|
Convert a pyhf workspace (HistFactory JSON) to an HS3 workspace. |
|
Convert an HS3 workspace of HistFactory channels to a pyhf workspace. |
|
pyhf's |
|
HS3 metadata containing version information and optional attribution. |
|
Package information for tracking software dependencies. |
Modules¶
Compiled negative log-likelihood for minimizers. |
|
HS3 Distribution implementations. |
|
HS3 Functions implementation. |
|
HS3 Axis implementations. |
|
HS3 Domain implementations. |
|
HS3 Parameter Point implementations. |
|
Parameter context of a model. |
|
HS3 Data implementations. |
|
HS3 Likelihood implementations. |
|
HS3 Analysis implementations. |
|
Exception classes for pyhs3. |
|
Normalization utilities for HS3 distributions. |
|
JAX transpilation helpers for pyhs3. |
Base Classes¶
Base class for HS3 distributions and functions with automatic parameter preprocessing. |
|
ABC for objects that have a name attribute. |
|
Generic collection providing dict-like access to named items. |
|
Context for parameter resolution in HS3 expressions. |
Compiled Likelihoods¶
Compile |
|
PyTensor mode |
|
Negative log-likelihood compiled as a function of one parameter vector. |
|
Negative log-likelihood evaluated at a batch of parameter vectors. |
Functions¶
Collection of HS3 functions for parameter computation. |
|
Base class for functions in HS3. |
|
A function type whose instances can be evaluated together, as one family. |
|
Product function that multiplies factors together. |
|
Sum function that adds summands together. |
|
Generic function with custom mathematical expression. |
|
Piecewise interpolation function implementation. |
|
Process normalization function with systematic variations. |
Distributions¶
Collection of distributions for a probabilistic model. |
|
Base class for probability distributions in HS3. |
|
A distribution type whose instances can be evaluated together, as one family. |
|
A distribution type that can draw values of one of its fields. |
|
Structured per-channel contributions to |
|
Gaussian (normal) probability distribution. |
|
Uniform (rectangular) probability distribution. |
|
Poisson probability distribution. |
|
Exponential probability distribution. |
|
Log-normal probability distribution. |
|
Landau probability distribution. |
|
Mixture of probability distributions. |
|
Product distribution implementation. |
|
Histogram probability distribution. |
|
Histogram data implementation for the HistogramFunction. |
|
Generic distribution implementation. |
|
Polynomial probability distribution. |
|
Bernstein polynomial probability distribution. |
|
Single-sided Crystal Ball distribution implementation. |
|
Crystal Ball distribution implementation. |
|
ARGUS probability distribution. |
|
Bukin distribution (NovosibirskA function). |
|
Relativistic Breit-Wigner distribution for a resonance in a two-body mass spectrum. |
|
One two-body decay channel of a |
|
HistFactory probability distribution for a single channel/region. |
|
CMS Fast Vertical Interpolation Histogram PDF (2D version). |
|
CMS ggZZ background distribution. |
|
CMS qqZZ background distribution. |
|
CMS Fast Vertical Interpolation Histogram PDF (2D version 2). |
HistFactory¶
HistFactory sample specification. |
|
Collection of samples for a HistFactory distribution. |
|
Sample data containing bin contents and optional per-bin uncertainties. |
|
Base class for modifier effects (multiplicative or additive). |
|
Base class for modifier data. |
|
Base class for modifiers that can have constraint terms. |
|
Base for modifiers that use a single parameter name. |
|
Base for modifiers that use multiple parameter names (one per bin). |
|
Normalization factor modifier (simple scaling by parameter value). |
|
Normalization systematic modifier (with hi/lo interpolation). |
|
Additive correlated shape systematic modifier. |
|
Uncorrelated multiplicative bin-by-bin scaling modifier. |
|
Uncorrelated shape systematic with per-bin constraints. |
|
Statistical uncertainty modifier (Barlow-Beeston method). |
|
Data for normsys modifier. |
|
Data for histosys modifier. |
|
Contents data for histosys modifier. |
|
Data for shapesys modifier. |
|
Data for staterror modifier. |
|
Collection of modifiers for a HistFactory sample. |
|
Constraint distribution of per-bin parameters whose nominal value is 1. |
Axes¶
Base axis specification for data coordinates. |
|
Axis with required finite min/max bounds. |
|
Axis for unbinned data with required finite bounds. |
|
Axis for constant data. |
|
Axis for domain coordinates with optional bounds. |
|
Runtime representation of an annotated type. |
|
Collection of binned axis. |
|
Collection of UnbinnedAxis. |
|
Collection of BinnedAxis | UnbinnedAxis. |
|
Collection of BinnedAxis | UnbinnedAxis. |
|
Domains¶
Collection of HS3 domains for parameter space definitions. |
|
Base class for HS3 domain specifications. |
|
Product domain specification for multi-dimensional parameter spaces. |
Parameter Points¶
Collection of HS3 parameter sets for model configuration. |
|
Named collection of parameter specifications (matches HS3Spec structure). |
|
Individual parameter specification with name and value. |
Parameter Context¶
Resolved parameter context: starting values, |
Data¶
Collection of HS3 data specifications. |
|
Base class for HS3 data specifications. |
|
Point data specification for single measurements. |
|
Unbinned data specification for multiple data points. |
|
Binned data specification for histogram data. |
|
Gaussian uncertainty specification for data. |
Parsing¶
Parse a mathematical expression string into a SymPy expression. |
|
Converts a SymPy expression into a PyTensor computational graph using lambdify. |
|
Analyzes a SymPy expression and logs its independent variables, dependent variables, and structure for debugging. |
|
Mixin for pydantic models that evaluate a user-supplied math expression string. |
Likelihoods¶
Collection of HS3 likelihood specifications. |
|
Likelihood specification mapping distributions to observations. |
Analyses¶
Exceptions¶
Base exception class for all pyhs3-related errors. |
|
Exception raised when a mathematical expression cannot be parsed. |
|
Exception raised when a parsed expression cannot be evaluated. |
|
Raised when a workspace fails to validate. |
|
Raised when an analysis violates HS3 section 2.7. |
|
Base for errors that name parameters an analysis must fix before its model builds. |
|
Raised when a free parameter of an analysis has no starting value. |
|
Raised when an analysis names a parameter of interest its likelihood does not use. |
|
Raised when a parameter that gets no constraint term must be |
|
Raised when two distinct entities share a single name in the dependency graph. |
|
Customize an error message for pydantic validation errors. |
Utilities¶
Compute a definite integral symbolically via Gauss-Legendre quadrature. |
|
Return |
|
Creates a tensor variable with optional domain constraints. |
|
Ensure a value is a numpy array with dtype float64. |
|
Return whether a tensor is a scalar constant equal to one. |
|
Return |