ModErn Text Analysis
META Enumerates Textual Applications
|
Represents a Dirichlet distribution. More...
#include <dirichlet.h>
Classes | |
union | parameters |
Public Member Functions | |
dirichlet (double alpha, uint64_t n) | |
Constructs a symmetric Dirichlet with concentration parameter \(\alpha\) and dimension \(n\). More... | |
template<class Iter > | |
dirichlet (Iter begin, Iter end) | |
Constructs a Dirichlet from a sequence of parameters that make up the parameter vector \(\mathbf{\alpha}\). More... | |
dirichlet (const dirichlet &other) | |
Copy constructor. | |
dirichlet (dirichlet &&other) | |
Move constructor. | |
dirichlet & | operator= (dirichlet rhs) |
Assignment operator. | |
~dirichlet () | |
Destructor. | |
double | pseudo_counts (const T &event) const |
Obtains the number of "pseudo-counts" associated with a given event when used as a prior for a multinomial distribution. More... | |
double | pseudo_counts () const |
Obtains the number of total "pseudo-counts" associated with this distribution when used as a prior for a multinomial distribution. | |
void | swap (dirichlet &other) |
Swaps this dirichlet with the parameter. More... | |
Private Types | |
enum | type { SYMMETRIC, ASYMMETRIC } |
Private Attributes | |
enum meta::stats::dirichlet::type | type_ |
union meta::stats::dirichlet::parameters | params_ |
double | alpha_sum_ |
Represents a Dirichlet distribution.
Typically used as a prior for multinomials in the language modeling, topic modeling, classification, and sequence labeling components.
meta::stats::dirichlet< T >::dirichlet | ( | double | alpha, |
uint64_t | n | ||
) |
Constructs a symmetric Dirichlet with concentration parameter \(\alpha\) and dimension \(n\).
alpha | The concentration parameter |
n | The dimensionality of the Dirichlet |
meta::stats::dirichlet< T >::dirichlet | ( | Iter | begin, |
Iter | end | ||
) |
Constructs a Dirichlet from a sequence of parameters that make up the parameter vector \(\mathbf{\alpha}\).
Each element is expected to be a std::pair<T, double>.
begin | An iterator to the beginning of the sequence |
end | An iterator to the ending of the sequence |
double meta::stats::dirichlet< T >::pseudo_counts | ( | const T & | event | ) | const |
Obtains the number of "pseudo-counts" associated with a given event when used as a prior for a multinomial distribution.
event | The event in question |
void meta::stats::dirichlet< T >::swap | ( | dirichlet< T > & | other | ) |
Swaps this dirichlet with the parameter.
other | The dirichlet to swap with |