1#ifndef STAN_MATH_PRIM_PROB_BETA_BINOMIAL_RNG_HPP
2#define STAN_MATH_PRIM_PROB_BETA_BINOMIAL_RNG_HPP
31template <
typename T_N,
typename T_shape1,
typename T_shape2,
class RNG>
38 static constexpr const char *function =
"beta_binomial_rng";
40 "Second prior sample size parameter",
beta);
43 T_alpha_ref alpha_ref = alpha;
44 T_beta_ref beta_ref =
beta;
51 auto p =
beta_rng(alpha_ref, beta_ref, rng);
typename helper::type type
VectorBuilder< true, int, T_N, T_shape1, T_shape2 >::type beta_binomial_rng(const T_N &N, const T_shape1 &alpha, const T_shape2 &beta, RNG &rng)
Return a beta-binomial random variate with the specified population size, success,...
VectorBuilder< true, int, T_N, T_theta >::type binomial_rng(const T_N &N, const T_theta &theta, RNG &rng)
Return a pseudorandom binomial random variable for the given population size and chance of success pa...
VectorBuilder< true, double, T_shape1, T_shape2 >::type beta_rng(const T_shape1 &alpha, const T_shape2 &beta, RNG &rng)
Return a Beta random variate with the supplied success and failure parameters using the given random ...
void check_nonnegative(const char *function, const char *name, const T_y &y)
Check if y is non-negative.
void check_consistent_sizes(const char *)
Trivial no input case, this function is a no-op.
fvar< T > beta(const fvar< T > &x1, const fvar< T > &x2)
Return fvar with the beta function applied to the specified arguments and its gradient.
void check_positive_finite(const char *function, const char *name, const T_y &y)
Check if y is positive and finite.
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 ...