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

\[L(x \mid b^{obs}): x o \pi(b^{obs} \mid x).\]

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

\[b^{obs} = A(x)+e,\]

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

\[B = AX+E,\]

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

\[L(x \mid b^{obs}) \propto \exp\left( -\frac{1}{2\sigma^2} \|b^{obs}-Ax\|_2^2 \right).\]

Classes

Likelihood

Likelihood function defined from a conditional distribution and some observed data.

UserDefinedLikelihood

Class to wrap user-defined likelihood functions.