Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ von_mises_rng()

template<typename T_loc , typename T_conc , class RNG >
VectorBuilder< true, double, T_loc, T_conc >::type stan::math::von_mises_rng ( const T_loc &  mu,
const T_conc &  kappa,
RNG &  rng 
)
inline

Return a von Mises random variate for the given location and concentration using the specified random number generator.

mu and kappa can each be a scalar or a vector. Any non-scalar inputs must be the same length.

The algorithm used in von_mises_rng is a modified version of the algorithm in:

Efficient Simulation of the von Mises Distribution D. J. Best and N. I. Fisher Journal of the Royal Statistical Society. Series C (Applied Statistics), Vol. 28, No. 2 (1979), pp. 152-157

For kappa < 1.4e-8, this reduces to a uniform distribution.

Template Parameters
T_loctype of location parameter
T_conctype of scale (concentration) parameter
RNGtype of random number generator
Parameters
mu(Sequence of) location parameter(s)
kappa(Sequence of) non-negative scale (concentration) parameter(s)
rngrandom number generator
Returns
(Sequence of) von Mises random variate(s)
Exceptions
std::domain_errorif mu is infinite or kappa is negative
std::invalid_argumentif non-scalar arguments are of different sizes

Definition at line 46 of file von_mises_rng.hpp.