1 #ifndef STAN_MATH_PRIM_SCAL_PROB_RAYLEIGH_RNG_HPP 2 #define STAN_MATH_PRIM_SCAL_PROB_RAYLEIGH_RNG_HPP 6 #include <boost/random/uniform_real_distribution.hpp> 7 #include <boost/random/variate_generator.hpp> 25 template <
typename T_scale,
class RNG>
27 const T_scale& sigma, RNG& rng) {
28 using boost::random::uniform_real_distribution;
29 using boost::variate_generator;
31 static const char*
function =
"rayleigh_rng";
39 variate_generator<RNG&, uniform_real_distribution<> >
uniform_rng(
40 rng, uniform_real_distribution<>(0.0, 1.0));
41 for (
size_t n = 0; n < N; ++n) {
fvar< T > sqrt(const fvar< T > &x)
fvar< T > log(const fvar< T > &x)
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.
VectorBuilder< true, double, T_alpha, T_beta >::type uniform_rng(const T_alpha &alpha, const T_beta &beta, RNG &rng)
Return a uniform random variate for the given upper and lower bounds using the specified random numbe...
void check_positive_finite(const char *function, const char *name, const T_y &y)
Check if y is positive and finite.
VectorBuilder< true, double, T_scale >::type rayleigh_rng(const T_scale &sigma, RNG &rng)
Return a Rayleigh random variate with scale parameter sigma using the specified random number generat...
VectorBuilder allocates type T1 values to be used as intermediate values.