1 #ifndef __STAN__PROB__DISTRIBUTIONS__UNIVARIATE__DISCRETE__BETA_BINOMIAL_HPP__
2 #define __STAN__PROB__DISTRIBUTIONS__UNIVARIATE__DISCRETE__BETA_BINOMIAL_HPP__
13 template <
bool propto,
17 typename boost::math::tools::promote_args<T_size1,T_size2>::type
23 static const char*
function =
"stan::prob::beta_binomial_log(%1%)";
28 using boost::math::tools::promote_args;
30 typename promote_args<T_size1,T_size2>::type lp;
33 if (!
check_finite(
function, alpha,
"First prior sample size parameter", &lp,
36 if (!
check_positive(
function, alpha,
"First prior sample size parameter",
39 if (!
check_finite(
function, beta,
"Second prior sample size parameter",
42 if (!
check_positive(
function, beta,
"Second prior sample size parameter",
56 lp +=
lbeta(n + alpha, N - n + beta) -
lbeta(alpha,beta);
60 template <
bool propto,
63 typename boost::math::tools::promote_args<T_size1,T_size2>::type
65 const T_size1& alpha,
const T_size2& beta) {
66 return beta_binomial_log<propto>(n,N,alpha,beta,
70 template <
typename T_size1,
73 typename boost::math::tools::promote_args<T_size1,T_size2>::type
76 const T_size1& alpha,
const T_size2& beta,
78 return beta_binomial_log<false>(n,N,alpha,beta,Policy());
81 template <
typename T_size1,
83 typename boost::math::tools::promote_args<T_size1,T_size2>::type
85 const T_size1& alpha,
const T_size2& beta) {
86 return beta_binomial_log<false>(n,N,alpha,beta,