pyhs3.distributions.histfactory.modifiers.HasConstraint

class pyhs3.distributions.histfactory.modifiers.HasConstraint[source]

Base class for modifiers that can have constraint terms.

__init__()

Methods

__init__()

log_constraint(context, sample_data)

Create constraint term for this modifier (log space).

make_constraint(context, sample_data)

Create constraint term for this modifier (probability space).

Attributes

abstractmethod HasConstraint.log_constraint(context, sample_data)[source]

Create constraint term for this modifier (log space).

Log-space counterpart of make_constraint(): evaluates the same constraint distribution(s) via their analytic log_likelihood instead of taking pt.log of the probability-space result, so the constraint stays finite where the probability-space value would underflow to 0.0.

Parameters:
Return type:

TypeAliasType

abstractmethod HasConstraint.make_constraint(context, sample_data)[source]

Create constraint term for this modifier (probability space).

Parameters:
Return type:

TypeAliasType

HasConstraint.constraint: Literal['Gauss', 'Poisson', 'LogNormal'] | None