1#ifndef STAN_MATH_PRIM_PROB_POISSON_BINOMIAL_LPMF_HPP
2#define STAN_MATH_PRIM_PROB_POISSON_BINOMIAL_LPMF_HPP
27template <
bool propto,
typename T_y,
typename T_theta>
29 const T_theta& theta) {
30 static constexpr const char* function =
"poisson_binomial_lpmf";
35 "Probability parameters", theta);
42 for (
size_t i = 0; i < max_sz; ++i) {
45 check_finite(function,
"Probability parameters", theta_vec.val(i));
46 check_bounded(function,
"Probability parameters", theta_vec.val(i), 0.0,
51 for (
size_t i = 0; i < max_sz; ++i) {
53 log_prob += x(y_vec[i]);
59template <
typename T_y,
typename T_theta>
61 const T_theta& theta) {
62 return poisson_binomial_lpmf<false>(y, theta);
scalar_seq_view provides a uniform sequence-like wrapper around either a scalar or a sequence of scal...
This class provides a low-cost wrapper for situations where you either need an Eigen Vector or RowVec...
return_type_t< T_theta > poisson_binomial_lpmf(const T_y &y, const T_theta &theta)
Returns the log PMF for the Poisson-binomial distribution evaluated at an specified array of numbers ...
int64_t size_mvt(const ScalarT &)
Provides the size of a multivariate argument.
typename return_type< Ts... >::type return_type_t
Convenience type for the return type of the specified template parameters.
int64_t size(const T &m)
Returns the size (number of the elements) of a matrix_cl or var_value<matrix_cl<T>>.
plain_type_t< T_theta > poisson_binomial_log_probs(int y, const T_theta &theta)
Returns the last row of the log probability matrix of the Poisson-Binomial distribution given the num...
void check_bounded(const char *function, const char *name, const T_y &y, const T_low &low, const T_high &high)
Check if the value is between the low and high values, inclusively.
void check_consistent_sizes(const char *)
Trivial no input case, this function is a no-op.
void check_finite(const char *function, const char *name, const T_y &y)
Return true if all values in y are finite.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...