1 #ifndef STAN_MATH_PRIM_SCAL_PROB_HYPERGEOMETRIC_LOG_HPP
2 #define STAN_MATH_PRIM_SCAL_PROB_HYPERGEOMETRIC_LOG_HPP
4 #include <boost/math/distributions.hpp>
27 template <
bool propto,
28 typename T_n,
typename T_N,
29 typename T_a,
typename T_b>
32 const T_a& a,
const T_b& b) {
33 static const char*
function(
"stan::math::hypergeometric_log");
58 for (
size_t i = 0; i <
size; i++) {
59 check_bounded(
function,
"Draws parameter minus successes variable",
60 N_vec[i]-n_vec[i], 0, b_vec[i]);
65 "Successes variable", n,
67 "Successes in population parameter", a,
68 "Failures in population parameter", b);
75 for (
size_t i = 0; i <
size; i++)
82 template <
typename T_n,
92 return hypergeometric_log<false>(n, N, a, b);
fvar< T > binomial_coefficient_log(const fvar< T > &x1, const fvar< T > &x2)
double hypergeometric_log(const T_n &n, const T_N &N, const T_a &a, const T_b &b)
size_t length(const std::vector< T > &x)
bool check_bounded(const char *function, const char *name, const T_y &y, const T_low &low, const T_high &high)
Return true if the value is between the low and high values, inclusively.
Template metaprogram to calculate whether a summand needs to be included in a proportional (log) prob...
size_t max_size(const T1 &x1, const T2 &x2)
bool check_finite(const char *function, const char *name, const T_y &y)
Return true if y is finite.
int size(const std::vector< T > &x)
Return the size of the specified standard vector.
bool check_consistent_sizes(const char *function, const char *name1, const T1 &x1, const char *name2, const T2 &x2)
Return true if the dimension of x1 is consistent with x2.
VectorView is a template metaprogram that takes its argument and allows it to be used like a vector...
bool check_greater(const char *function, const char *name, const T_y &y, const T_low &low)
Return true if y is strictly greater than low.