Stan Math Library  2.15.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 
15 #include <boost/random/normal_distribution.hpp>
16 #include <boost/random/variate_generator.hpp>
17 
18 namespace stan {
19  namespace math {
20 
21  template <class RNG>
22  inline double
23  exp_mod_normal_rng(double mu,
24  double sigma,
25  double lambda,
26  RNG& rng) {
27  static const char* function("exp_mod_normal_rng");
28 
29  check_finite(function, "Location parameter", mu);
30  check_positive_finite(function, "Inv_scale parameter", lambda);
31  check_positive_finite(function, "Scale parameter", sigma);
32 
33  return normal_rng(mu, sigma, rng)
34  + exponential_rng(lambda, rng);
35  }
36 
37  }
38 }
39 #endif
40 
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.