1#ifndef STAN_MATH_PRIM_PROB_BETA_PROPORTION_RNG_HPP
2#define STAN_MATH_PRIM_PROB_BETA_PROPORTION_RNG_HPP
9#include <boost/random/variate_generator.hpp>
34template <
typename T_loc,
typename T_prec,
class RNG>
39 static constexpr const char *function =
"beta_proportion_rng";
41 "Precision parameter", kappa);
43 T_kappa_ref kappa_ref = kappa;
45 check_less(function,
"Location parameter", mu_ref, 1.0);
53 for (
size_t n = 0; n < N; ++n) {
54 double alpha = mu_vec[n] * kappa_vec[n];
55 double beta = kappa_vec[n] - alpha;
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, 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 ...
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...
void check_consistent_sizes(const char *)
Trivial no input case, this function is a no-op.
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, Idxs... idxs)
Throw an exception if y is not strictly less than high.
int64_t max_size(const T1 &x1, const Ts &... xs)
Calculate the size of the largest input.
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 ...