spey.backends.default_pdf.EffectiveSigma#
- class spey.backends.default_pdf.EffectiveSigma(signal_yields: ndarray, background_yields: ndarray, data: ndarray, correlation_matrix: ndarray, absolute_uncertainty_envelops: List[Tuple[float, float]], signal_uncertainty_configuration: Dict[str, Any] | None = None)[source]#
Simplified likelihood interface with variable Gaussian. Variable Gaussian has been inspired by [arXiv:physics/0406120] sec. 3.6. This method modifies the effective \(B:=\sigma_{eff}\) term in the Poisson distribution of the simplified likelihood framework. Note that this approach does not modify the Gaussian of the likelihood, the naming of the approach is purely because it is originated from [arXiv:physics/0406120] sec. 3.6. The effective sigma term of the Poissonian can be modified using upper, \(\sigma^+\) and lower \(\sigma^-\) envelops of the absolute background uncertainties (see eqs 18-19 in [arXiv:physics/0406120]).
\[\sigma_{eff}(\theta) = \sqrt{\sigma^+\sigma^- + (\sigma^+ - \sigma^-)(\theta - n_{bkg})}\]where the simplified likelihoo is modified as
\[\mathcal{L}(\mu,\theta) = \left[\prod_i^N{\rm Poiss}(n^i_{obs}|\mu n^i_s + n^i_{bkg} + \theta^i\sigma_{eff}^i(\theta)) \right]\cdot \mathcal{N}(\theta| 0, \rho)\]Note
This likelihood is constrained by
\[n^i_{bkg} + \theta^i\sigma_{eff}^i(\theta) \geq 0\]- Parameters:
signal_yields (
np.ndarray
) – signal yieldsbackground_yields (
np.ndarray
) – background yieldsdata (
np.ndarray
) – observationscorrelation_matrix (
np.ndarray
) – correlations between regionsabsolute_uncertainty_envelops (
List[Tuple[float, float]]
) – upper and lower uncertainty envelops for each background yield.signal_uncertainty_configuration (
Dict[Text, Any]]
, defaultNone
) –Configuration input for signal uncertainties
absolute_uncertainties (
List[float]
): Absolute uncertainties for the signal- absolute_uncertainty_envelops (
List[Tuple[float, float]]
): upper and lower uncertainty envelops
- absolute_uncertainty_envelops (
correlation_matrix (
List[List[float]]
): Correlation matrixthird_moments (
List[float]
): diagonal elemetns of the third moment
- __init__(signal_yields: ndarray, background_yields: ndarray, data: ndarray, correlation_matrix: ndarray, absolute_uncertainty_envelops: List[Tuple[float, float]], signal_uncertainty_configuration: Dict[str, Any] | None = None)[source]#
Methods
__init__
(signal_yields, background_yields, ...)asimov_negative_loglikelihood
([poi_test, ...])Compute negative log-likelihood at fixed \(\mu\) for Asimov data.
combine
(other, **kwargs)A routine to combine to statistical models.
config
([allow_negative_signal, poi_upper_bound])Model configuration.
expected_data
(pars[, include_auxiliary])Compute the expected value of the statistical model
get_hessian_logpdf_func
([expected, data])Currently Hessian of \(\log\mathcal{L}(\mu, \theta)\) is only used to compute variance on \(\mu\).
get_logpdf_func
([expected, data])Generate function to compute \(\log\mathcal{L}(\mu, \theta)\) where \(\mu\) is the parameter of interest and \(\theta\) are nuisance parameters.
get_objective_function
([expected, data, do_grad])Objective function i.e. twice negative log-likelihood, \(-2\log\mathcal{L}(\mu, \theta)\).
get_sampler
(pars)Retreives the function to sample from.
minimize_asimov_negative_loglikelihood
([...])A backend specific method to minimize negative log-likelihood for Asimov data.
minimize_negative_loglikelihood
([expected, ...])A backend specific method to minimize negative log-likelihood.
negative_loglikelihood
([poi_test, expected])Backend specific method to compute negative log-likelihood for a parameter of interest \(\mu\).
Attributes
constraints
Constraints to be used during optimisation process
signal_uncertainty_configuration
arXiv
arXiv reference for the backend
author
Author of the backend
constraint_model
retreive constraint model distribution
doi
Citable DOI for the backend
is_alive
Returns True if at least one bin has non-zero signal yield.
main_model
retreive the main model distribution
name
Name of the backend
spey_requires
Spey version required for the backend
version
Version of the backend