1#ifndef STAN_MATH_PRIM_PROB_DIRICHLET_MULTINOMIAL_RNG_HPP
2#define STAN_MATH_PRIM_PROB_DIRICHLET_MULTINOMIAL_RNG_HPP
38 const Eigen::Matrix<double, Eigen::Dynamic, 1>& alpha,
int N, RNG& rng) {
39 static const char* function =
"dirichlet_multinomial_rng";
40 const auto& alpha_ref =
to_ref(alpha);
46 return std::vector<int>(alpha.size(), 0);
std::vector< int > dirichlet_multinomial_rng(const Eigen::Matrix< double, Eigen::Dynamic, 1 > &alpha, int N, RNG &rng)
Return a draw from a Dirichlet-Multinomial distribution with specified parameters and and pseudo-ra...
std::vector< int > multinomial_rng(const T_theta &theta, int N, RNG &rng)
Return a draw from a Multinomial distribution given a probability simplex, a total count,...
Eigen::VectorXd dirichlet_rng(const Eigen::Matrix< double, Eigen::Dynamic, 1 > &alpha, RNG &rng)
Return a draw from a Dirichlet distribution with specified parameters and pseudo-random number genera...
void check_nonnegative(const char *function, const char *name, const T_y &y)
Check if y is non-negative.
ref_type_t< T && > to_ref(T &&a)
This evaluates expensive Eigen expressions.
void check_positive_finite(const char *function, const char *name, const T_y &y)
Check if y is positive and finite.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...