1#ifndef STAN_MATH_PRIM_PROB_BERNOULLI_RNG_HPP
2#define STAN_MATH_PRIM_PROB_BERNOULLI_RNG_HPP
8#include <boost/random/bernoulli_distribution.hpp>
9#include <boost/random/variate_generator.hpp>
28template <
typename T_theta,
class RNG>
30 const T_theta& theta, RNG& rng) {
31 using boost::bernoulli_distribution;
32 using boost::variate_generator;
33 static constexpr const char* function =
"bernoulli_rng";
42 for (
size_t n = 0; n < N; ++n) {
43 variate_generator<RNG&, bernoulli_distribution<> >
bernoulli_rng(
44 rng, bernoulli_distribution<>(theta_vec[n]));
typename helper::type type
VectorBuilder allocates type T1 values to be used as intermediate values.
scalar_seq_view provides a uniform sequence-like wrapper around either a scalar or a sequence of scal...
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...
int64_t size(const T &m)
Returns the size (number of the elements) of a matrix_cl or var_value<matrix_cl<T>>.
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.
typename ref_type_if< true, T >::type ref_type_t
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...