This page is outdated and needs to be rewritten to account for the replacement of the deprecated flavio.statistics.fits
module by flavio.statistics.likelihood
.
As discussed above, Bayesian inference is based on prior distributions for fit and nuisance parameters in addition to the liklihood and requires marginalization to determine the posterior distribution of the parameters of interest.
To define a Bayesian fit of SM parameters (e.g. the CKM parameters) to experimental data, at least the following inputs have to be specified:
For instance, a CKM fit could look like
Once defined, you can access the logarithm of the target distribution (likelihood times prior probability) via
where x is a list (or NumPy array) of real numbers, with the first four being the values of the fit parameters and the remaining ones the values of the nuisance parameters.
To fit Wilson coefficients in addition to (or instead of) parameters, the following four additional inputs have to be passed when defining the fit instance:
The first two items are necessary as the quantities to be fitted need to be real numbers, while the Wilson coefficients are in general complex objects, so real and imaginary parts have to be treated as independent fit parameters. In addition, this allows to fit constrained scenarios such as MFV or models with lepton flavour universality.
For details please consult the API docs.
As discussed above, the log_target
method of the BayesianFit
instance gives access to the lihelihood times prior as a function of fit parameters, nuisance parameters, and fitted Wilson coefficients.
To obtain the posterior probability distribution, Markov Chain Monte Carlo (MCMC) techniques can be used. At present, simple interfaces to the pypmc and emcee packages are implemented.
The flavio.statistics.fitters.pypmc
module gives access to adaptive Markov chains as implemented in pypmc. The initial proposal distribution is a multivariate Gauss determined from a random sample of parameters distributed according to their prior distribution.
For more details, see the pypmc documentation and the API docs of the pypmc
module.
The flavio.statistics.fitters.emcee
module implements an interface to the emcee package. The starting points of the individual “walkers” are obtained by randomly sampling from the prior.
For more details, see the emcee website and the API docs of the emcee
module.
To visualize posterior distributions in one or two dimensions, the flavio.plots
module provides several convenient functions. For usage examples see this notebook and for details please consult the API docs.