Likelihood

Similar to component, Likelihood takes all registered Component and compares it with data, and calulate binned Poisson log likelihood. The base is

class appletree.Likelihood(name: Optional[str] = None, **config)[source]

Bases: object

Combine all components (e.g. ER, AC, Wall), and calculate log posterior likelihood.

__getitem__(keys)[source]

Get component in likelihood.

__init__(name: Optional[str] = None, **config)[source]

Create an appletree likelihood.

Parameters

config – Dictionary with configuration options that will be applied, should include: * data_file_name: the data used in fitting, usually calibration data * bins_type: either meshgrid or equiprob * bins_on: observables where we will perform inference on, usually [cs1, cs2] * x_clip, y_clip: ROI of the fitting, should be list of upper and lower boundary * parameter_alias: alias of parameters that will be renamed from key to value

_sanity_check()[source]

Check equality between number of bins group and observables.

get_log_likelihood(*args, **kwargs)[source]
get_num_events_accepted(*args, **kwargs)[source]
property lineage
property lineage_hash
print_likelihood_summary(indent: str = '    ', short: bool = True)[source]

Print likelihood summary: components, bins, file names.

Parameters
  • indent – str of indent.

  • short – bool, whether only print short summary.

register_component(component_cls: Type[Component], component_name: str, file_name: Optional[str] = None)[source]

Create an appletree likelihood.

Parameters
  • component_cls – class of Component.

  • component_name – name of Component.

  • file_name – file used in ComponentFixed.

replace_alias(parameters)[source]

Replace alias in parameters from key to value.

Note that the value will be popped out.

set_binning(config)[source]

Set binning of likelihood.

simulate_weighted_data(*args, **kwargs)[source]

See also