|
Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
|
Classes | |
| class | MCConfig |
| class | MCObservableCovariance |
| class | MCRealization |
| class | MCResult |
Functions | |
| _require (value, typ, str name) | |
| _cpp_binned_observable_id (BinnedObservableId obs) | |
| _cpp_param_id (ParamId pid) | |
| ObsSample | _obs_sample_from_cpp (row) |
| _obs_sample_to_cpp (Mapping[BinnedObservableId, float] row) | |
| NuisanceSample | _nuisance_sample_from_cpp (row) |
| _nuisance_sample_to_cpp (Mapping[ParamId, float] row) | |
| List[BinnedObservableId] | covariance_ids_from_first_sample (Sequence[Mapping[BinnedObservableId, float]] samples) |
| MCObservableCovariance | covariance_from_obs_samples (Sequence[Mapping[BinnedObservableId, float]] samples, Sequence[BinnedObservableId] ids, float ridge_rel=1e-8, float ridge_abs=1e-12) |
Monte-Carlo result wrappers for the statistic module. The C++ statistic layer can sample nuisance parameters, propagate them through the observable model, summarize the resulting observable samples and estimate an observable covariance matrix. This module exposes Python dataclasses mirroring those C++ result structures.
|
protected |
Convert a Python binned observable id to C++.
Definition at line 41 of file MCResult.py.
|
protected |
Convert a Python parameter id to C++.
Definition at line 46 of file MCResult.py.
|
protected |
Convert one C++ nuisance sample row to a Python mapping.
Definition at line 61 of file MCResult.py.
|
protected |
Convert one Python nuisance sample row to a C++ mapping.
Definition at line 66 of file MCResult.py.
|
protected |
Convert one C++ observable sample row to a Python mapping.
Definition at line 51 of file MCResult.py.
|
protected |
Convert one Python observable sample row to a C++ mapping.
Definition at line 56 of file MCResult.py.
|
protected |
Validate a wrapper argument type and return the original value.
Definition at line 34 of file MCResult.py.
| MCObservableCovariance MCResult.covariance_from_obs_samples | ( | Sequence[Mapping[BinnedObservableId, float]] | samples, |
| Sequence[BinnedObservableId] | ids, | ||
| float | ridge_rel = 1e-8, |
||
| float | ridge_abs = 1e-12 |
||
| ) |
Estimate an observable covariance matrix from Monte-Carlo samples.
Args:
samples: Observable samples produced by Monte-Carlo propagation.
ids: Observable ordering to use for the covariance matrix.
ridge_rel: Relative diagonal ridge added before matrix inversion.
ridge_abs: Absolute minimum diagonal ridge.
Returns:
A ``MCObservableCovariance`` containing the mean, covariance and inverse
covariance.
Examples:
>>> ids = covariance_ids_from_first_sample(samples)
>>> cov = covariance_from_obs_samples(samples, ids)
>>> len(cov.ids) == len(cov.mean)
True
Definition at line 240 of file MCResult.py.
| List[BinnedObservableId] MCResult.covariance_ids_from_first_sample | ( | Sequence[Mapping[BinnedObservableId, float]] | samples | ) |
Return the observable ordering inferred from the first sample.
Args:
samples: Sequence of observable sample mappings.
Returns:
Observable identifiers in the backend order inferred from the first row.
Raises:
Exception: Propagates backend errors, for example when ``samples`` is
empty.
Definition at line 218 of file MCResult.py.