ssmkit
master-68aed98
|
Categorical (multinomial) distribution. More...
Public Member Functions | |
Categorical () | |
Default constructor \(\mathbf{p}=[1.0]\). More... | |
Categorical (TParameterVar parameters) | |
Constructor. More... | |
TValueType | random () |
Return a random variable from the distribution. More... | |
double | likelihood (const TValueType &rv) |
Return likelihood of the given random variable. More... | |
Categorical & | parameterize (const TParameterVar ¶m) |
Change parameters of the distribution. More... | |
Categorical (multinomial) distribution.
\begin{equation}p(x|\mathbf{p}) = \mathcal{Cat}(\mathbf{p})\end{equation}
where \(\mathbf{p} = [p_0, \cdots, p_N]^T\) and \(p(x=i|\mathbf{p}) = p_i\)
Definition at line 22 of file categorical.hpp.
|
inline |
Default constructor \(\mathbf{p}=[1.0]\).
Definition at line 40 of file categorical.hpp.
|
inline |
Constructor.
parameter | The parameter vector \(\mathbf{p}\). |
parameter
should be 1.0. Definition at line 45 of file categorical.hpp.
|
inline |
Return a random variable from the distribution.
Definition at line 48 of file categorical.hpp.
References Generator::get().
|
inline |
Return likelihood of the given random variable.
Definition at line 57 of file categorical.hpp.
|
inline |
Change parameters of the distribution.
parameter | The parameter vector \(\mathbf{p}\). |
parameter
should be 1.0. Definition at line 65 of file categorical.hpp.