1 #ifndef STAN_MATH_PRIM_SCAL_PROB_POISSON_RNG_HPP 2 #define STAN_MATH_PRIM_SCAL_PROB_POISSON_RNG_HPP 9 #include <boost/random/poisson_distribution.hpp> 10 #include <boost/random/variate_generator.hpp> 28 template <
typename T_rate,
class RNG>
30 const T_rate& lambda, RNG& rng) {
31 using boost::random::poisson_distribution;
32 using boost::variate_generator;
34 static const char*
function =
"poisson_rng";
44 for (
size_t n = 0; n < N; ++n) {
45 variate_generator<RNG&, poisson_distribution<> >
poisson_rng(
46 rng, poisson_distribution<>(lambda_vec[n]));
scalar_seq_view provides a uniform sequence-like wrapper around either a scalar or a sequence of scal...
VectorBuilder< true, int, T_rate >::type poisson_rng(const T_rate &lambda, RNG &rng)
Return a Poisson random variate with specified rate parameter using the given random number generator...
size_t length(const std::vector< T > &x)
Returns the length of the provided std::vector.
void check_not_nan(const char *function, const char *name, const T_y &y)
Check if y is not NaN.
const double POISSON_MAX_RATE
Largest rate parameter allowed in Poisson RNG.
VectorBuilder allocates type T1 values to be used as intermediate values.
void check_positive(const char *function, const char *name, const T_y &y)
Check if y is positive.
void check_less(const char *function, const char *name, const T_y &y, const T_high &high)
Check if y is strictly less than high.