Stan Math Library
4.9.0
Automatic Differentiation
|
|
inline |
Return a draw from a Dirichlet distribution with specified parameters and pseudo-random number generator.
For prior counts greater than zero, the usual algorithm that draws gamma variates and normalizes is used.
For prior counts less than zero (i.e., parameters with value less than one), a log-scale version of the following algorithm is used to deal with underflow:
G. Marsaglia and W. Tsang. A simple method for generating gamma variables. ACM Transactions on Mathematical Software. 26(3):363–372, 2000.
RNG | type of pseudo-random number generator |
alpha | Prior count (plus 1) parameter for Dirichlet. |
rng | Pseudo-random number generator. |
Definition at line 39 of file dirichlet_rng.hpp.