spey.backends.default_pdf.simple_pdf.Gaussian#
- class spey.backends.default_pdf.simple_pdf.Gaussian(signal_yields: List[float] | Callable[[ndarray], ndarray], background_yields: List[float], data: List[int], absolute_uncertainties: List[float], n_signal_parameters: int = 0, signal_parameter_bounds: List[Tuple[float | None, float | None]] | None = None)[source]#
Product of independent Gaussians — uncorrelated normal likelihood (
default.normal).This backend replaces the Poisson term with a Gaussian approximation, which is accurate when the expected counts are large. The likelihood is
\[\mathcal{L}(\mu) = \prod_{i=1}^{N} \frac{1}{\sigma_i \sqrt{2\pi}} \exp\!\left[-\frac{(\mu n^s_i + n^b_i - n^{\rm obs}_i)^2} {2\sigma_i^2}\right],\]where \(\sigma_i\) is the absolute uncertainty in bin \(i\).
Because the bins are independent this is equivalent to a \(\chi^2\) goodness-of-fit test with the total prediction \(\mu n^s_i + n^b_i\) as the hypothesis.
Added in version 0.1.9.
- Parameters:
signal_yields (
List[float]) – Per-bin signal yields \(\{n^s_i\}\).background_yields (
List[float]) – Per-bin expected background yields \(\{n^b_i\}\).data (
List[int]) – Per-bin observed counts \(\{n^{\rm obs}_i\}\).absolute_uncertainties (
List[float]) – Per-bin absolute uncertainties \(\{\sigma_i\}\) that enter the Gaussian widths.n_signal_parameters (
int, default0) – number of additional free parameters to pass to a callablesignal_yields. Has no effect whensignal_yieldsis a plain array. When greater than zero the optimiser parameter vector is extended to[mu, signal_par_0, ..., signal_par_{n-1}].signal_parameter_bounds (
List[Tuple[Optional[float], Optional[float]]] | None) – Optimiser bounds for each extra signal parameter. Each entry is a(lower, upper)pair; useNonefor an unbounded side. WhenNone, every extra signal parameter receives(None, None). Must have exactlyn_signal_parametersentries when provided.
- __init__(signal_yields: List[float] | Callable[[ndarray], ndarray], background_yields: List[float], data: List[int], absolute_uncertainties: List[float], n_signal_parameters: int = 0, signal_parameter_bounds: List[Tuple[float | None, float | None]] | None = None)[source]#
Methods
__init__(signal_yields, background_yields, ...)asimov_negative_loglikelihood([poi_test, ...])Compute the profiled negative log-likelihood at fixed \(\mu\) on Asimov data.
combine(other, **kwargs)Combine this statistical model with another backend instance.
config([allow_negative_signal, poi_upper_bound])Model configuration.
expected_data(pars, **kwargs)Compute the expected data vector \(\{\lambda_i(\mu)\}\) at the given parameter point.
get_hessian_logpdf_func([expected, data])Return a callable that evaluates the Hessian of \(\ln\mathcal{L}(\mu)\).
get_logpdf_func([expected, data])Return a callable that evaluates \(\ln\mathcal{L}(\mu)\).
get_objective_function([expected, data, do_grad])Return the objective function \(-\ln\mathcal{L}(\mu)\) used by the optimiser.
get_sampler(pars)Return a callable that draws pseudo-data from the main model.
minimize_asimov_negative_loglikelihood([...])Find the global minimum of the negative log-likelihood on Asimov data (free fit).
minimize_negative_loglikelihood([expected, ...])Find the global minimum of the negative log-likelihood (free fit).
negative_loglikelihood([poi_test, expected])Compute the profiled negative log-likelihood at a fixed \(\mu\).
Attributes
absolute_uncertaintiesabsolute uncertainties on the background
authorAuthor of the backend
background_yieldsdatais_aliveReturns True if at least one bin has non-zero signal yield.
main_modelMain model distribution — Poisson (or Gaussian) term of the likelihood.
nameName of the backend
signal_yieldsspey_requiresSpey version required for the backend
versionVersion of the backend
constraintsConstraints to be used during optimisation process
n_signal_parametersNumber of signal parameters