1 #ifndef __STAN__PROB__DISTRIBUTIONS__UNIVARIATE__DISCRETE__ORDERED_LOGISTIC_HPP__
2 #define __STAN__PROB__DISTRIBUTIONS__UNIVARIATE__DISCRETE__ORDERED_LOGISTIC_HPP__
52 template <
bool propto,
56 typename boost::math::tools::promote_args<T_lambda,T_cut>::type
58 const T_lambda& lambda,
59 const Eigen::Matrix<T_cut,Eigen::Dynamic,1>& c,
68 static const char*
function =
"stan::prob::ordered_logistic(%1%)";
80 typename boost::math::tools::promote_args<T_lambda,T_cut>::type lp(0.0);
87 "Location parameter", &lp, Policy()))
91 "Size of cut points parameter",
96 for (
int i = 1; i < c.size(); ++i) {
98 "Cut points parameter",
104 "Cut points parameter",
109 "Cut points parameter",
130 template <
bool propto,
133 typename boost::math::tools::promote_args<T_lambda,T_cut>::type
135 const T_lambda& lambda,
136 const Eigen::Matrix<T_cut,Eigen::Dynamic,1>& c) {
141 template <
typename T_lambda,
144 typename boost::math::tools::promote_args<T_lambda,T_cut>::type
146 const T_lambda& lambda,
147 const Eigen::Matrix<T_cut,Eigen::Dynamic,1>& c,
149 return ordered_logistic_log<false>(y,lambda,c,Policy());
153 template <
typename T_lambda,
155 typename boost::math::tools::promote_args<T_lambda,T_cut>::type
157 const T_lambda& lambda,
158 const Eigen::Matrix<T_cut,Eigen::Dynamic,1>& c) {
var log1p_exp(const stan::agrad::var &a)
Return the log of 1 plus the exponential of the specified variable.
var log1m(const stan::agrad::var &a)
The log (1 - x) function for variables.
var log(const var &a)
Return the natural log of the specified variable (cmath).
var exp(const var &a)
Return the exponentiation of the specified variable (cmath).
boost::math::tools::promote_args< T >::type log1m(T x)
Return the natural logarithm of one minus the specified value.
bool check_less(const char *function, const T_y &y, const T_high &high, const char *name, T_result *result, const Policy &)
boost::math::tools::promote_args< T >::type inv_logit(T a)
Returns the inverse logit function applied to the argument.
double log1p_exp(const double &a)
Calculates the log of 1 plus the exponential of the specified value without overflow.
bool check_greater(const char *function, const T_y &y, const T_low &low, const char *name, T_result *result, const Policy &)
bool check_less_or_equal(const char *function, const T_y &y, const T_high &high, const char *name, T_result *result, const Policy &)
bool check_bounded(const char *function, const T_y &y, const T_low &low, const T_high &high, const char *name, T_result *result, const Policy &)
bool check_positive(const char *function, const T_y &y, const char *name, T_result *result, const Policy &)
bool check_finite(const char *function, const T_y &y, const char *name, T_result *result, const Policy &)
Checks if the variable y is finite.
bool check_nonnegative(const char *function, const T_y &y, const char *name, T_result *result, const Policy &)
boost::math::policies::policy default_policy
Default error-handling policy from Boost.
T log_inv_logit_diff(const T &alpha, const T &beta)
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, const Policy &)
Returns the (natural) log probability of the specified integer outcome given the continuous location ...
Probability, optimization and sampling library.