Implements a Dirichlet distribution.
More...
#include <shark/Rng/Dirichlet.h>
|
| Dirichlet (RngType &rng, size_t n=3, double alpha=1) |
| C'tor, associates the distribution with the given generator. More...
|
|
| Dirichlet (RngType &rng, const std::vector< double > &alphas) |
| C'tor, associates the distribution with the given generator. More...
|
|
std::vector< double > | operator() (size_t n, double alpha) |
| Creates a temporary instance of the distribution and samples it. More...
|
|
std::vector< double > | operator() (const std::vector< double > &alphas) |
| Creates a temporary instance of the distribution and samples it. More...
|
|
const std::vector< double > | alphas () const |
| Accesses the support values. More...
|
|
void | alphas (const std::vector< double > &newAlphas) |
| Adjusts the support values. More...
|
|
void | alphas (size_t n, double alphas) |
| Adjusts the support values. More...
|
|
double | p (const std::vector< double > &x) const |
| Calculates the probability of the observation x. More...
|
|
template<typename RngType = shark::DefaultRngType>
class shark::Dirichlet< RngType >
Implements a Dirichlet distribution.
- Template Parameters
-
RngType | The underlying generator type. |
Definition at line 126 of file Dirichlet.h.
§ Dirichlet() [1/2]
template<typename RngType = shark::DefaultRngType>
C'tor, associates the distribution with the given generator.
- Parameters
-
[in,out] | rng | Random number generator. |
[in] | n | Cardinality. |
[in] | alpha | Support value. |
Definition at line 138 of file Dirichlet.h.
§ Dirichlet() [2/2]
template<typename RngType = shark::DefaultRngType>
C'tor, associates the distribution with the given generator.
- Parameters
-
[in,out] | rng | Random number generator. |
[in] | alphas | Support values. |
Definition at line 147 of file Dirichlet.h.
§ alphas() [1/3]
template<typename RngType = shark::DefaultRngType>
Accesses the support values.
Definition at line 176 of file Dirichlet.h.
§ alphas() [2/3]
template<typename RngType = shark::DefaultRngType>
void shark::Dirichlet< RngType >::alphas |
( |
const std::vector< double > & |
newAlphas | ) |
|
|
inline |
Adjusts the support values.
- Parameters
-
[in] | newAlphas | New support values. |
Definition at line 184 of file Dirichlet.h.
§ alphas() [3/3]
template<typename RngType = shark::DefaultRngType>
§ operator()() [1/2]
template<typename RngType = shark::DefaultRngType>
std::vector<double> shark::Dirichlet< RngType >::operator() |
( |
size_t |
n, |
|
|
double |
alpha |
|
) |
| |
|
inline |
Creates a temporary instance of the distribution and samples it.
- Parameters
-
[in] | n | Cardinality. |
[in] | alpha | Support value. |
Definition at line 159 of file Dirichlet.h.
§ operator()() [2/2]
template<typename RngType = shark::DefaultRngType>
std::vector<double> shark::Dirichlet< RngType >::operator() |
( |
const std::vector< double > & |
alphas | ) |
|
|
inline |
Creates a temporary instance of the distribution and samples it.
- Parameters
-
[in] | alphas | Support values. |
Definition at line 168 of file Dirichlet.h.
§ p()
template<typename RngType = shark::DefaultRngType>
The documentation for this class was generated from the following file: