1 #ifndef STAN_MATH_PRIM_MAT_PROB_ORDERED_LOGISTIC_LOG_HPP
2 #define STAN_MATH_PRIM_MAT_PROB_ORDERED_LOGISTIC_LOG_HPP
4 #include <boost/random/uniform_01.hpp>
5 #include <boost/random/variate_generator.hpp>
59 template <
bool propto,
typename T_lambda,
typename T_cut>
60 typename boost::math::tools::promote_args<T_lambda, T_cut>::type
62 const Eigen::Matrix<T_cut, Eigen::Dynamic, 1>& c) {
69 static const char*
function(
"stan::math::ordered_logistic");
83 check_greater(
function,
"Size of cut points parameter", c.size(), 0);
84 for (
int i = 1; i < c.size(); ++i)
85 check_greater(
function,
"Cut points parameter", c(i), c(i - 1));
87 check_finite(
function,
"Cut points parameter", c(c.size()-1));
105 template <
typename T_lambda,
typename T_cut>
106 typename boost::math::tools::promote_args<T_lambda, T_cut>::type
108 const Eigen::Matrix<T_cut, Eigen::Dynamic, 1>& c) {
109 return ordered_logistic_log<false>(y, lambda, c);
bool check_less(const char *function, const char *name, const T_y &y, const T_high &high)
Return true if y is strictly less than high.
fvar< T > log(const fvar< T > &x)
fvar< T > inv_logit(const fvar< T > &x)
bool check_bounded(const char *function, const char *name, const T_y &y, const T_low &low, const T_high &high)
Return true if the value is between the low and high values, inclusively.
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)
bool check_positive(const char *function, const char *name, const T_y &y)
Return true if y is positive.
bool check_less_or_equal(const char *function, const char *name, const T_y &y, const T_high &high)
Return true if y is less or equal to high.
bool check_finite(const char *function, const char *name, const T_y &y)
Return true if y is finite.
fvar< T > log1p_exp(const fvar< T > &x)
bool check_nonnegative(const char *function, const char *name, const T_y &y)
Return true if y is non-negative.
fvar< T > log1m(const fvar< T > &x)
boost::math::tools::promote_args< T_lambda, T_cut >::type ordered_logistic_log(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 ...
bool check_greater(const char *function, const char *name, const T_y &y, const T_low &low)
Return true if y is strictly greater than low.