Skip to content

Is there/could there be an "official" Model._modifications(pars) implementation? #1414

Answered by alexander-held
lhenkelm asked this question in Ideas
Discussion options

You must be logged in to vote

Hi, if you are looking for pre- and post-fit distributions, the Model.main_model.expected_data API is suitable (I think this is not documented in the API since _MainModel is not public?):

pyhf/src/pyhf/pdf.py

Lines 479 to 505 in 671ed56

def expected_data(self, pars, return_by_sample=False):
"""
Compute the expected rates for given values of parameters.
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
- …

Replies: 1 comment 11 replies

Comment options

You must be logged in to vote
11 replies
@lukasheinrich
Comment options

@matthewfeickert
Comment options

@lhenkelm
Comment options

@matthewfeickert
Comment options

@lukasheinrich
Comment options

Answer selected by lhenkelm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
4 participants