1#ifndef STAN_MATH_PRIM_PROB_YULE_SIMON_RNG_HPP
2#define STAN_MATH_PRIM_PROB_YULE_SIMON_RNG_HPP
29template <
typename T_alpha,
typename RNG>
31 static constexpr const char* function =
"yule_simon_rng";
32 decltype(
auto) alpha_ref =
to_ref(std::forward<T_alpha>(alpha));
35 auto w =
exponential_rng(std::forward<
decltype(alpha_ref)>(alpha_ref), rng);
38 const auto odds_ratio_p
41 if constexpr (is_stan_scalar_v<T_alpha>) {
auto to_array_1d(T_x &&x)
Returns input matrix reshaped into a vector.
VectorBuilder< true, int, T_shape, T_inv >::type neg_binomial_rng(const T_shape &alpha, const T_inv &beta, RNG &rng)
Return a negative binomial random variate with the specified shape and inverse scale parameters using...
auto yule_simon_rng(T_alpha &&alpha, RNG &rng)
Return a yule-simon random variate with the given shape parameter, using the given random number gene...
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...
T as_array_or_scalar(T &&v)
Returns specified input value.
fvar< T > log(const fvar< T > &x)
ref_type_t< T && > to_ref(T &&a)
This evaluates expensive Eigen expressions.
fvar< T > log1m(const fvar< T > &x)
void check_positive_finite(const char *function, const char *name, const T_y &y)
Check if y is positive and finite.
fvar< T > exp(const fvar< T > &x)
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...