| Stan Math Library 2.6.3 probability, sampling & optimization

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
weibull_rng.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_SCAL_PROB_WEIBULL_RNG_HPP
2 #define STAN_MATH_PRIM_SCAL_PROB_WEIBULL_RNG_HPP
3
4 #include <boost/random/weibull_distribution.hpp>
5 #include <boost/random/variate_generator.hpp>
6 #include <stan/math/prim/scal/meta/OperandsAndPartials.hpp>
7 #include <stan/math/prim/scal/err/check_consistent_sizes.hpp>
8 #include <stan/math/prim/scal/err/check_finite.hpp>
9 #include <stan/math/prim/scal/err/check_nonnegative.hpp>
10 #include <stan/math/prim/scal/err/check_not_nan.hpp>
11 #include <stan/math/prim/scal/err/check_positive_finite.hpp>
12 #include <stan/math/prim/scal/fun/multiply_log.hpp>
13 #include <stan/math/prim/scal/fun/value_of.hpp>
14 #include <stan/math/prim/scal/meta/length.hpp>
15 #include <stan/math/prim/scal/fun/constants.hpp>
16 #include <stan/math/prim/scal/meta/include_summand.hpp>
17
18 namespace stan {
19
20 namespace math {
21
22 template <class RNG>
23 inline double
24 weibull_rng(const double alpha,
25 const double sigma,
26 RNG& rng) {
27 using boost::variate_generator;
28 using boost::random::weibull_distribution;
29
30 static const char* function("stan::math::weibull_rng");
31
32 using stan::math::check_positive_finite;
33
34 check_positive_finite(function, "Shape parameter", alpha);
35 check_positive_finite(function, "Scale parameter", sigma);
36
37 variate_generator<RNG&, weibull_distribution<> >
38 weibull_rng(rng, weibull_distribution<>(alpha, sigma));
39 return weibull_rng();
40 }
41 }
42 }
43 #endif
check_not_nan.hpp
check_positive_finite.hpp
include_summand.hpp
multiply_log.hpp
check_nonnegative.hpp
OperandsAndPartials.hpp
stan::math::weibull_rng
double weibull_rng(const double alpha, const double sigma, RNG &rng)
Definition: weibull_rng.hpp:24
length.hpp
constants.hpp
check_finite.hpp
value_of.hpp
check_consistent_sizes.hpp
stan::math::check_positive_finite
bool check_positive_finite(const char *function, const char *name, const T_y &y)
Return true if y is positive and finite.
Definition: check_positive_finite.hpp:28

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