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:
objectCombine all components (e.g. ER, AC, Wall), and calculate log posterior 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
- _make_data_hist(use_meshgrid=False)[source]
Create the data histogram from self.data and self._bins.
- _print_components(indent: str = ' ', short: bool = True)[source]
Print component details shared by Likelihood and LikelihoodLit.
- _resolve_bin_edges(bin_spec, clip_range, config, warn_key)[source]
Resolve a single axis bin specification into bin edges.
- Parameters
bin_spec – int (number of bins) or array-like (explicit edges).
clip_range – tuple of (lo, hi) for linspace when bin_spec is int.
config – the full config dict.
warn_key – config key (e.g. “x_clip”) to check for spurious warning.
- _resolve_explicit_bins(config)[source]
Resolve explicit bin specs (meshgrid or irreg) into a tuple of arrays.
- 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.
See also