MultipleLikelihoodPosterior#

class cuqi.distribution.MultipleLikelihoodPosterior(*densities)#

A posterior distribution with multiple likelihoods and a single prior.

Parameters:

densities (Distribution or Likelihood) – The densities that make up the Posterior. Must include at least three densities. For a simple Likelihood and prior use Posterior instead.

Notes

This acts like a regular distribution with a single parameter vector. Behind-the-scenes it is a joint posterior distribution with multiple likelihoods and a single prior. This is mostly intended to be used by samplers that are not able to handle joint distributions. See JointDistribution for more details on the joint distribution.

__init__(*densities)#

Initialize the core properties of the distribution.

Parameters:
  • name (str, default None) – Name of distribution.

  • geometry (Geometry, default _DefaultGeometry (or None)) – Geometry of distribution.

  • is_symmetric (bool, default None) – Indicator if distribution is symmetric.

Methods

__init__(*densities)

Initialize the core properties of the distribution.

disable_FD()

Disable finite difference approximation for logd gradient.

enable_FD([epsilon])

Enable finite difference approximation for logd gradient.

get_conditioning_variables()

Return the conditioning variables of this distribution (if any).

get_density(name)

Return a density with the given name.

get_mutable_variables()

Return any public variable that is mutable (attribute or property) except those in the ignore_vars list

get_parameter_names()

Returns the parameter names of the joint distribution.

gradient(*args, **kwargs)

Return the gradient of the un-normalized log density function.

logd(*args, **kwargs)

Evaluate the un-normalized log density function.

logpdf(*args, **kwargs)

Evaluate the log probability density function of the distribution.

pdf(x)

Evaluate the log probability density function of the distribution.

sample([N])

Sample from the distribution.

to_likelihood(data)

Convert conditional distribution to a likelihood function given observed data

Attributes

FD_enabled

Returns True if finite difference approximation of the logd gradient is enabled.

FD_epsilon

Spacing for the finite difference approximation of the logd gradient.

dim

Return the dimension of the distribution.

geometry

The geometry of the distribution.

is_cond

Returns True if instance (self) is a conditional distribution.

likelihoods

Return the likelihoods of the posterior.

models

Return the forward models that make up the posterior.

name

Name of the random variable associated with the density.

prior

Return the prior distribution of the posterior.