ssmkit  master-68aed98
Conditional< TPDF, TParamMap > Class Template Reference

Conditional distribution function. More...

Public Member Functions

 Conditional (TPDF pdf, TParamMap map)
 Constructors returns a conditional distribution object. More...
 
template<typename... Args>
auto random (const Args &...args) -> decltype(std::declval< TPDF >().random())
 Sample from distribution. More...
 
template<typename... Args>
double likelihood (const decltype(std::declval< TPDF >().random())&rv, const Args &...args)
 Calculate the likelihood of a random variable. More...
 
const TPDF & getPDF () const
 Returns a reference to \(\mathcal{F}(\theta)\). More...
 
const TParamMap & getParamMap () const
 Returns a reference to \(g(.)\). More...
 

Detailed Description

template<typename TPDF, typename TParamMap>
class ssmkit::distribution::Conditional< TPDF, TParamMap >

Conditional distribution function.

Let \(x \in X\) and \((y_0, \cdots, y_N) \in \{Y_0, \cdots, Y_n\} \), the class defines a conditional distribution of \(x\) given \(y_0, \cdots, y_N\):

\begin{equation}p(x|y_0, \cdots, y_N) = \mathcal{F}(g(y_0, \cdots, y_N))\end{equation}

where \(\mathcal{F}(\theta)\) is a probability distribution with parameter \(\theta \in \Theta \) and \(g:\{Y_0, \cdots, Y_n\} \rightarrow \Theta\) is a function that maps a set of variables \({y_0^*, \cdots, y_N^*}\) to a parameter \(\theta^*\), i.e. \(\theta^* = g(y_0^*, \cdots, y_N^*)\).

Template Parameters
TPDFType of the distribution \(\mathcal{F}(\theta)\)
TParamMapType of the parameter map \(g(.)\)
conditional.png
Bayesian network representation of conditional distribution

Definition at line 34 of file conditional.hpp.

Constructor & Destructor Documentation

Conditional ( TPDF  pdf,
TParamMap  map 
)
inline

Constructors returns a conditional distribution object.

Note
use makeConditional builder for convenient template argument deduction.
Parameters
pdfA probability distribution object that implements \(\mathcal{F}(\theta)\).
mapA callable object that implements \(g(.)\).
Precondition
pdf should provide random, likelihood and parameterize methods, e.g. Gaussian. map should be callable with return type equivalent to parameter type of pdf, e.g. map::LinearGaussian.

Definition at line 45 of file conditional.hpp.

Member Function Documentation

auto random ( const Args &...  args) -> decltype(std::declval<TPDF>().random())
inline

Sample from distribution.

Parameters
args...Condition variables \(y_0, \cdots, y_N\).
Returns
random variable \(x\).

Definition at line 53 of file conditional.hpp.

double likelihood ( const decltype(std::declval< TPDF >().random())&  rv,
const Args &...  args 
)
inline

Calculate the likelihood of a random variable.

Parameters
args...Condition variables \(y_0, \cdots, y_N\).
rvrandom variable \(x\).
Returns
likelihood \(p(x|y_0, \cdots, y_N)\).

Definition at line 65 of file conditional.hpp.

const TPDF& getPDF ( ) const
inline

Returns a reference to \(\mathcal{F}(\theta)\).

Definition at line 72 of file conditional.hpp.

const TParamMap& getParamMap ( ) const
inline

Returns a reference to \(g(.)\).

Definition at line 74 of file conditional.hpp.


The documentation for this class was generated from the following file: