spey.backends.default_pdf.simple_pdf.MultivariateNormal#
- class spey.backends.default_pdf.simple_pdf.MultivariateNormal(signal_yields: List[float], background_yields: List[float], data: List[int], covariance_matrix: List[List[float]])[source]#
Multivariate Gaussian distribution.
\[\mathcal{L}(\mu) = \frac{1}{\sqrt{(2\pi)^k {\rm det}[\Sigma] }} \exp\left[-\frac{1}{2} (\mu n_s + n_b - n)\Sigma^{-1} (\mu n_s + n_b - n)^T \right]\]where \(n_{s,b}\) are signal and background yields and \(n\) are the observations.
Added in version 0.1.9.
- Parameters:
signal_yields (
List[float]
) – signal yieldsbackground_yields (
List[float]
) – background yieldsdata (
List[int]
) – datacovariance_matrix (
List[List[float]]
) –covariance matrix (square matrix)
If you have correlation matrix and absolute uncertainties please use
correlation_to_covariance()
- __init__(signal_yields: List[float], background_yields: List[float], data: List[int], covariance_matrix: List[List[float]])[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, **kwargs)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. negative log-likelihood, \(-\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
covariance_matrix
author
Author of the backend
background_yields
data
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
signal_yields
spey_requires
Spey version required for the backend
version
Version of the backend