pisa.stages.likelihood package
Submodules
pisa.stages.likelihood.generalized_llh_params module
Pisa stage that pre-computes some quantities needed for the generalized likelihood, and applies small adjustments to the weight distributions in cases where the number of mc event per bin is low.
The code does the following, in order:
Calculate the number of MC events per bin once, at the setup time
Calculate, at setup time, a mean adjustment, based on the average number of MC events per bin. If the latter is less than one, adjustment is applied, else that quantity is equal to zero
Populate ANY empty mc bin with a pseudo-weight with a value equal to the maximal weight value of a given dataset. This correspond to the empty bin strategy #2 described in (1902.08831). Note that empty bin strategy #1 can still be applied later on, if one provides the bin indices where no datasets have any MC events. This step runs in the apply function because the value of the pseudo weight will change during minimization.
Once this is done, computes the alpha and beta parameters that are fed into the likelihood
The stage appends / modifies the following:
- weights: changes the individual weight distribution
based on the empty bin filling outcome
llh_alphas: Map (alpha parameters of the generalized likelihood)
llh_betas: Map (beta parameters of the generalized likelihood)
n_mc_events: Map (number of MC events in each bin
- new_sum: Map (Sum of the weights in each bin (ie MC expectation),
corrected for the empty bin filling and the mean adjustment
- class pisa.stages.likelihood.generalized_llh_params.generalized_llh_params(**std_kwargs)[source]
Bases:
Stage
Pisa stage that applies mean adjustment and empty bin filling. Also computes alphas and betas that are needed by the generalized poisson likelihood