1"""Python wrapper for parameter and observable correlations."""
3from __future__
import annotations
9from pyhyperiso.phyperiso.pyhyperiso.core
import CorrelationProvider
as _CppCorrelationProvider
11_CppCorrelationType = _CppCorrelationProvider.CorrelationType
15 """Type of uncertainty correlation to query.
18 STAT: Statistical-only correlation.
19 SYST: Systematic-only correlation.
20 COMBINED: Correlation after combining statistical and systematic
21 components according to the C++ provider rules.
24 STAT = _CppCorrelationType.STAT
25 SYST = _CppCorrelationType.SYST
26 COMBINED = _CppCorrelationType.COMBINED
30 """Read correlations stored by the C++ core.
32 The provider supports two correlation domains:
34 * parameter correlations, addressed with ``ParamId``;
35 * experimental observable correlations, addressed with ``Observables``.
38 >>> corr = CorrelationProvider()
39 >>> corr.correlation_from_observable(
40 ... Observables.BR_B_XS_GAMMA,
41 ... Observables.BR_B_XS_GAMMA,
42 ... CorrelationType.COMBINED,
48 """Create a provider bound to the current C++ correlation storage."""
55 corr_type: CorrelationType,
57 """Return the correlation between two parameters.
60 pid_1: First parameter identifier.
61 pid_2: Second parameter identifier.
62 corr_type: Statistical, systematic or combined correlation type.
65 Correlation coefficient, typically in ``[-1, 1]``.
67 return float(self.
_cpp_obj(pid_1._cpp_obj, pid_2._cpp_obj, corr_type.value))
73 corr_type: CorrelationType,
74 experiment: str =
"DEFAULT",
76 """Return the experimental correlation between two observables.
79 obs_1: First observable enum.
80 obs_2: Second observable enum.
81 corr_type: Statistical, systematic or combined correlation type.
84 Correlation coefficient, typically in ``[-1, 1]``.
86 return float(self.
_cpp_obj(experiment, obs_1.value, obs_2.value, corr_type.value))
89__all__ = [
"CorrelationProvider",
"CorrelationType"]
float correlation_from_paramid(self, ParamId pid_1, ParamId pid_2, CorrelationType corr_type)
float correlation_from_observable(self, Observables obs_1, Observables obs_2, CorrelationType corr_type, str experiment="DEFAULT")