ssmkit
master-68aed98
|
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... | |
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^*)\).
TPDF | Type of the distribution \(\mathcal{F}(\theta)\) |
TParamMap | Type of the parameter map \(g(.)\) |
Definition at line 34 of file conditional.hpp.
|
inline |
Constructors returns a conditional distribution object.
A probability distribution object that implements \(\mathcal{F}(\theta)\). | |
map | A callable object that implements \(g(.)\). |
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.
|
inline |
Sample from distribution.
args... | Condition variables \(y_0, \cdots, y_N\). |
Definition at line 53 of file conditional.hpp.
|
inline |
Calculate the likelihood of a random variable.
args... | Condition variables \(y_0, \cdots, y_N\). |
rv | random variable \(x\). |
Definition at line 65 of file conditional.hpp.
|
inline |
Returns a reference to \(\mathcal{F}(\theta)\).
Definition at line 72 of file conditional.hpp.
|
inline |
Returns a reference to \(g(.)\).
Definition at line 74 of file conditional.hpp.