Stan Math Library  2.14.0
reverse mode automatic differentiation
exp_mod_normal_rng.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_SCAL_PROB_EXP_MOD_NORMAL_RNG_HPP
2 #define STAN_MATH_PRIM_SCAL_PROB_EXP_MOD_NORMAL_RNG_HPP
3 
16 #include <boost/random/normal_distribution.hpp>
17 #include <boost/random/variate_generator.hpp>
18 
19 namespace stan {
20  namespace math {
21 
22  template <class RNG>
23  inline double
24  exp_mod_normal_rng(double mu,
25  double sigma,
26  double lambda,
27  RNG& rng) {
28  static const char* function("exp_mod_normal_rng");
29 
30  check_finite(function, "Location parameter", mu);
31  check_positive_finite(function, "Inv_scale parameter", lambda);
32  check_positive_finite(function, "Scale parameter", sigma);
33 
34  return normal_rng(mu, sigma, rng)
35  + exponential_rng(lambda, rng);
36  }
37 
38  }
39 }
40 #endif
41 
void check_finite(const char *function, const char *name, const T_y &y)
Check if y is finite.
double exponential_rng(double beta, RNG &rng)
double normal_rng(double mu, double sigma, RNG &rng)
Definition: normal_rng.hpp:18
void check_positive_finite(const char *function, const char *name, const T_y &y)
Check if y is positive and finite.
double exp_mod_normal_rng(double mu, double sigma, double lambda, RNG &rng)

     [ Stan Home Page ] © 2011–2016, Stan Development Team.