likelihood#
Module path: cuqi.likelihood
The Likelihood
represents the likelihood function commonly used in conjunction
with a prior to define a cuqi.distribution.Posterior
or cuqi.problem.BayesianProblem
.
Quick example#
Create a Gaussian likelihood function from a forward model and observed data
import cuqi
model, data, probInfo = cuqi.testproblem.Deconvolution1D().get_components()
likelihood = cuqi.distribution.Gaussian(mean=model, cov=0.05**2).to_likelihood(data)
Mathematical details#
Given a conditional distribution \(\pi(b \mid x)\) and a observed data \(b^{obs}\) the likelihood function is defined as
The most commonly use-case of the likelihood function is to define the likelihood function for a Bayesian inverse problem with Gaussian measurement noise.
Consider the inverse problem
where \(b^{obs}\in\mathbb{R}^m\) is the (noisy) measurement, \(e\in\mathbb{R}^m\) is the measurement noise, \(x\in\mathbb{R}^n\) is the solution to the inverse problem and \(A: \mathbb{R}^n \to \mathbb{R}^m\) is the forward model.
The stochastic extension of the inverse problem is
where \(B, X\) and \(E\) are random variables.
Assuming Gaussian measurement noise \(E\sim\mathcal{N}(0, \sigma^2 I)\) the data follows the distribution \(B \mid X=x \sim\mathcal{N}(A(x),\sigma^2I)\) and given an observation \(b^{obs}\) the likelihood function is given by
Classes
Likelihood function defined from a conditional distribution and some observed data. |
|
Class to wrap user-defined likelihood functions. |