1#ifndef STAN_MATH_PRIM_PROB_POISSON_BINOMIAL_RNG_HPP
2#define STAN_MATH_PRIM_PROB_POISSON_BINOMIAL_RNG_HPP
7#include <boost/random/bernoulli_distribution.hpp>
8#include <boost/random/variate_generator.hpp>
24template <
typename T_theta,
typename RNG,
25 require_eigen_vt<std::is_arithmetic, T_theta>* =
nullptr>
27 static constexpr const char* function =
"poisson_binomial_rng";
32 for (
size_t i = 0; i < theta.size(); ++i) {
33 boost::variate_generator<RNG&, boost::bernoulli_distribution<> >
34 bernoulli_rng(rng, boost::bernoulli_distribution<>(theta(i)));
VectorBuilder< true, int, T_theta >::type bernoulli_rng(const T_theta &theta, RNG &rng)
Return a Bernoulli random variate with specified chance of success parameter using the specified rand...
int poisson_binomial_rng(const T_theta &theta, RNG &rng)
Return a pseudorandom Poisson binomial random variable for the given vector of success parameters usi...
void check_bounded(const char *function, const char *name, const T_y &y, const T_low &low, const T_high &high)
Check if the value is between the low and high values, inclusively.
T value_of(const fvar< T > &v)
Return the value of the specified variable.
void check_finite(const char *function, const char *name, const T_y &y)
Return true if all values in y are finite.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...