1 #ifndef STAN_MATH_PRIM_SCAL_PROB_BETA_PROPORTION_RNG_HPP 2 #define STAN_MATH_PRIM_SCAL_PROB_BETA_PROPORTION_RNG_HPP 5 #include <boost/random/variate_generator.hpp> 33 template <
typename T_loc,
typename T_prec,
class RNG>
36 static const char *
function =
"beta_proportion_rng";
42 "Precision parameter", kappa);
49 for (
size_t n = 0; n < N; ++n) {
50 double alpha = mu_vec[n] * kappa_vec[n];
51 double beta = kappa_vec[n] - alpha;
52 output[n] =
beta_rng(alpha, beta, rng);
void check_less_or_equal(const char *function, const char *name, const T_y &y, const T_high &high)
Check if y is less or equal to high.
scalar_seq_view provides a uniform sequence-like wrapper around either a scalar or a sequence of scal...
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 ...
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.
size_t max_size(const T1 &x1, const T2 &x2)
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_consistent_sizes(const char *function, const char *name1, const T1 &x1, const char *name2, const T2 &x2)
Check if the dimension of x1 is consistent with x2.
VectorBuilder< true, double, T_loc, T_prec >::type beta_proportion_rng(const T_loc &mu, const T_prec &kappa, RNG &rng)
Return a Beta random variate specified probability, location, and precision parameters: beta_proporti...