ssmkit  master-68aed98
Categorical Class Reference

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...
 
Categoricalparameterize (const TParameterVar &param)
 Change parameters of the distribution. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

Categorical ( )
inline

Default constructor \(\mathbf{p}=[1.0]\).

Definition at line 40 of file categorical.hpp.

Categorical ( TParameterVar  parameters)
inline

Constructor.

Parameters
parameterThe parameter vector \(\mathbf{p}\).
Precondition
The sum of the elements of parameter should be 1.0.

Definition at line 45 of file categorical.hpp.

Member Function Documentation

TValueType random ( )
inline

Return a random variable from the distribution.

Definition at line 48 of file categorical.hpp.

References Generator::get().

double likelihood ( const TValueType &  rv)
inline

Return likelihood of the given random variable.

Definition at line 57 of file categorical.hpp.

Categorical& parameterize ( const TParameterVar &  param)
inline

Change parameters of the distribution.

Parameters
parameterThe parameter vector \(\mathbf{p}\).
Precondition
The sum of the elements of parameter should be 1.0.

Definition at line 65 of file categorical.hpp.


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