1#ifndef STAN_MATH_PRIM_PROB_ORDERED_PROBIT_LPMF_HPP
2#define STAN_MATH_PRIM_PROB_ORDERED_PROBIT_LPMF_HPP
47template <
bool propto,
typename T_y,
typename T_loc,
typename T_cut>
54 static constexpr const char* function =
"ordered_probit";
60 int K = c_vec[0].size() + 1;
65 "Number of cutpoint vectors ", C_l);
71 for (
int i = 0; i <
size_mvt(c); ++i) {
76 check_finite(function,
"Final cut point", c_vec[i].coeff(K - 2));
78 check_finite(function,
"First cut point", c_vec[i].coeff(0));
81 T_lambda_ref lambda_ref = lambda;
82 check_finite(function,
"Location parameter", lambda_ref);
87 for (
int i = 0; i < N; ++i) {
88 int K = c_vec[i].size() + 1;
92 }
else if (y_vec[i] == K) {
103template <
typename T_y,
typename T_loc,
typename T_cut>
107 return ordered_probit_lpmf<false>(y, lambda, c);
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_loc, T_cut > ordered_probit_lpmf(const T_y &y, const T_loc &lambda, const T_cut &c)
Returns the (natural) log probability of the specified array of integers given the vector of continuo...
return_type_t< T_y_cl > std_normal_lcdf(const T_y_cl &y)
Returns the log standard normal complementary cumulative distribution function.
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>>.
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.
fvar< T > log_diff_exp(const fvar< T > &x1, const fvar< T > &x2)
void check_nonzero_size(const char *function, const char *name, const T_y &y)
Check if the specified matrix/vector is of non-zero size.
void check_ordered(const char *function, const char *name, const T_y &y)
Throw an exception if the specified vector is not sorted into strictly increasing order.
void check_size_match(const char *function, const char *name_i, T_size1 i, const char *name_j, T_size2 j)
Check if the provided sizes match.
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 ...