pyhs3.distributions.LogProbTerms

class pyhs3.distributions.LogProbTerms(per_event=<factory>, channel=<factory>, constraints=<factory>)[source]

Structured per-channel contributions to pyhs3.Model.log_prob.

Distributions describe what they contribute via Distribution.log_prob_terms(); the model owns the channel-dataset pairing and decides how the pieces enter the joint log-likelihood (event weighting, summing over events, global constraint deduplication).

per_event

Log-density terms with the observable as a free pt.vector input, broadcasting to shape (N, M) for N events and parameter batch size M. The model sums these over the event axis (applying per-event weights when present).

channel

Scalar terms added once per channel, broadcasting onto the (M,) parameter batch axis (e.g. the -nu yield term of an extended mixture).

constraints

Log-terms keyed by factor name, depending only on scalar nuisance parameters. The model adds each name exactly once globally, so constraints shared across channels are not double-counted.

Parameters:
  • per_event (list[TypeAliasType])

  • channel (list[TypeAliasType])

  • constraints (dict[str, TypeAliasType])

__init__(per_event=<factory>, channel=<factory>, constraints=<factory>)
Parameters:
  • per_event (list[TypeAliasType])

  • channel (list[TypeAliasType])

  • constraints (dict[str, TypeAliasType])

Methods

__init__([per_event, channel, constraints])

Attributes

LogProbTerms.per_event: list[TensorVar]
LogProbTerms.channel: list[TensorVar]
LogProbTerms.constraints: dict[str, TensorVar]