1 #ifndef STAN_MATH_PRIM_MAT_PROB_ORDERED_LOGISTIC_LPMF_HPP 2 #define STAN_MATH_PRIM_MAT_PROB_ORDERED_LOGISTIC_LPMF_HPP 4 #include <boost/random/uniform_01.hpp> 5 #include <boost/random/variate_generator.hpp> 55 template <
bool propto,
typename T_lambda,
typename T_cut>
56 typename boost::math::tools::promote_args<T_lambda, T_cut>::type
58 const Eigen::Matrix<T_cut, Eigen::Dynamic, 1>& c) {
62 static const char*
function(
"ordered_logistic");
68 check_greater(
function,
"Size of cut points parameter", c.size(), 0);
69 for (
int i = 1; i < c.size(); ++i)
70 check_greater(
function,
"Cut points parameter", c(i), c(i - 1));
72 check_finite(
function,
"Cut points parameter", c(c.size()-1));
90 template <
typename T_lambda,
typename T_cut>
91 typename boost::math::tools::promote_args<T_lambda, T_cut>::type
93 const Eigen::Matrix<T_cut, Eigen::Dynamic, 1>& c) {
94 return ordered_logistic_lpmf<false>(y, lambda, c);
void check_finite(const char *function, const char *name, const T_y &y)
Check if y is finite.
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.
fvar< T > log(const fvar< T > &x)
T log_inv_logit_diff(const T &alpha, const T &beta)
fvar< T > exp(const fvar< T > &x)
fvar< T > log1m_exp(const fvar< T > &x)
Return the natural logarithm of one minus the exponentiation of the specified argument.
fvar< T > log1p_exp(const fvar< T > &x)
boost::math::tools::promote_args< T_lambda, T_cut >::type ordered_logistic_lpmf(int y, const T_lambda &lambda, const Eigen::Matrix< T_cut, Eigen::Dynamic, 1 > &c)
Returns the (natural) log probability of the specified integer outcome given the continuous location ...
void check_greater(const char *function, const char *name, const T_y &y, const T_low &low)
Check if y is strictly greater than low.