pyhs3.distributions.histfactory.modifiers.HistoSysModifier¶
- class pyhs3.distributions.histfactory.modifiers.HistoSysModifier(**data)[source]¶
Additive correlated shape systematic modifier.
- Parameters:
data (
Any)
Fields¶ Field
Type
Required
Default
Literal[‘additive’]No
'additive'Literal[‘Gauss’, ‘Poisson’, ‘LogNormal’]No
'Gauss'Yes
Yes
Yes
Literal[‘histosys’]No
'histosys'- __init__(**data)¶
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (
Any)
Methods
apply(context, rates)Apply histosys (additive systematic) modifier.
constraint_distribution(context, _)Construct the Gauss/Poisson/LogNormal constraint distribution.
expression(context)Return the histosys parameter value for dependency graph evaluation.
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).
unconstrained_parameters(sample_data)Parameters that scale a positive yield but get no constraint term.
Attributes
Auxiliary data value for histosys (always 0.0).
Return parameter names this modifier depends on.
Whether this modifier applies additively to rates.
Whether this modifier applies multiplicatively to rates.
- HistoSysModifier.constraint_distribution(context, _)¶
Construct the Gauss/Poisson/LogNormal constraint distribution.
Shared by
make_constraint()andlog_constraint()so the parametrization (which distribution, and with which parameter/constant values) is defined exactly once. The global observablex, a scalar constant namedconstraint_{name}_x, is 0 forGauss(Gauss(0 | alpha, 1)) and 1 forPoisson(Pois(1 | alpha)) andLogNormal(LogNormal(1 | mu = alpha, sigma = 1)).- Parameters:
context (
Context)_ (
SampleData)
- Return type:
- HistoSysModifier.expression(context)[source]¶
Return the histosys parameter value for dependency graph evaluation.
For histosys modifiers, the actual additive variation calculation happens in apply() since it depends on the nominal rates. This method returns just the parameter value for the dependency graph to track parameter dependencies correctly.
- HistoSysModifier.log_constraint(context, sample_data)¶
Create constraint term for this modifier (log space).
Log-space counterpart of
make_constraint(): evaluates the same constraint distribution(s) via their analyticlog_likelihoodinstead of takingpt.logof the probability-space result, so the constraint stays finite where the probability-space value would underflow to 0.0.- Parameters:
context (
Context)sample_data (
SampleData)
- Return type:
- HistoSysModifier.make_constraint(context, sample_data)¶
Create constraint term for this modifier (probability space).
- Parameters:
context (
Context)sample_data (
SampleData)
- Return type:
- HistoSysModifier.unconstrained_parameters(sample_data)¶
Parameters that scale a positive yield but get no constraint term.
A per-bin parameter whose bin has a positive yield and zero uncertainty is left out of the constraint; pyhf and ROOT fix it at its nominal value, so it must be
const. Modifiers with one constrained parameter have none.- Parameters:
sample_data (
SampleData)- Return type:
- HistoSysModifier.auxdata¶
Auxiliary data value for histosys (always 0.0).
- HistoSysModifier.dependencies¶
Return parameter names this modifier depends on.
- HistoSysModifier.is_additive¶
Whether this modifier applies additively to rates.
- HistoSysModifier.is_multiplicative¶
Whether this modifier applies multiplicatively to rates.
- HistoSysModifier.type¶
- HistoSysModifier.application¶
- HistoSysModifier.constraint¶
- HistoSysModifier.data¶
- HistoSysModifier.name¶
- HistoSysModifier.parameter¶