1 #ifndef STAN_MATH_PRIM_SCAL_PROB_EXPONENTIAL_RNG_HPP 2 #define STAN_MATH_PRIM_SCAL_PROB_EXPONENTIAL_RNG_HPP 6 #include <boost/random/exponential_distribution.hpp> 7 #include <boost/random/variate_generator.hpp> 25 template <
typename T_inv,
class RNG>
27 const T_inv&
beta, RNG& rng) {
28 using boost::exponential_distribution;
29 using boost::variate_generator;
31 static const char*
function =
"exponential_rng";
39 for (
size_t n = 0; n < N; ++n) {
40 variate_generator<RNG&, exponential_distribution<> > exp_rng(
41 rng, exponential_distribution<>(beta_vec[n]));
42 output[n] = exp_rng();
scalar_seq_view provides a uniform sequence-like wrapper around either a scalar or a sequence of scal...
size_t length(const std::vector< T > &x)
Returns the length of the provided std::vector.
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.
VectorBuilder allocates type T1 values to be used as intermediate values.
VectorBuilder< true, double, T_inv >::type exponential_rng(const T_inv &beta, RNG &rng)
Return a exponential random variate with inverse scale beta using the specified random number generat...