1#ifndef STAN_MATH_PRIM_PROB_NEG_BINOMIAL_2_LCDF_HPP
2#define STAN_MATH_PRIM_PROB_NEG_BINOMIAL_2_LCDF_HPP
17template <
typename T_n,
typename T_location,
typename T_precision>
19 const T_n& n,
const T_location& mu,
const T_precision& phi) {
24 static constexpr const char* function =
"neg_binomial_2_lcdf";
26 mu,
"Precision Parameter", phi);
30 T_phi_ref phi_ref = phi;
44 size_t size_phi_mu =
max_size(mu, phi);
46 for (
size_t i = 0; i < size_n; i++) {
55 for (
size_t i = 0; i < size_phi_mu; i++) {
56 phi_mu[i] = phi_vec[i] / (phi_vec[i] + mu_vec[i]);
60 for (
size_t i = 0; i < size_n; i++) {
61 np1[i] = n_vec[i] + 1.0;
VectorBuilder allocates type T1 values to be used as intermediate values.
scalar_seq_view provides a uniform sequence-like wrapper around either a scalar or a sequence of scal...
return_type_t< T_y, T_scale_succ, T_scale_fail > beta_cdf_log(const T_y &y, const T_scale_succ &alpha, const T_scale_fail &beta)
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>>.
static constexpr double LOG_ZERO
The natural logarithm of 0, .
bool size_zero(const T &x)
Returns 1 if input is of length 0, returns 0 otherwise.
void check_consistent_sizes(const char *)
Trivial no input case, this function is a no-op.
void check_not_nan(const char *function, const char *name, const T_y &y)
Check if y is not NaN.
return_type_t< T_location, T_precision > neg_binomial_2_lcdf(const T_n &n, const T_location &mu, const T_precision &phi)
int64_t max_size(const T1 &x1, const Ts &... xs)
Calculate the size of the largest input.
void check_positive_finite(const char *function, const char *name, const T_y &y)
Check if y is positive and finite.
typename ref_type_if< true, T >::type ref_type_t
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...