Model

class pyhf.pdf.Model(spec, **config_kwargs)[source]

Bases: object

Methods

__init__(spec, **config_kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

constraint_logpdf(auxdata, pars)[source]
expected_actualdata(pars)[source]

For a single channel single sample, we compute

Pois(d | fac(pars) * (delta(pars) + nom) ) * Gaus(a | pars[is_gaus], sigmas) * Pois(a * cfac | pars[is_poi] * cfac)

where:
  • delta(pars) is the result of an apply(pars) of combined modifiers with ‘addition’ op_code

  • factor(pars) is the result of apply(pars) of combined modifiers with ‘multiplication’ op_code

  • pars[is_gaus] are the subset of parameters that are constrained by gauss (with sigmas accordingly, some of which are computed by modifiers)

  • pars[is_pois] are the poissons and their rates (they come with their own additional factors unrelated to factor(pars) which are also computed by the finalize() of the modifier)

So in the end we only make 3 calls to pdfs

  1. The main pdf of data and modified rates

  2. All Gaussian constraint as one call

  3. All Poisson constraints as one call

expected_auxdata(pars)[source]
expected_data(pars, include_auxdata=True)[source]
logpdf(pars, data)[source]
mainlogpdf(maindata, pars)[source]
pdf(pars, data)[source]