1 #ifndef STAN_MATH_PRIM_MAT_FUN_SIMPLEX_CONSTRAIN_HPP 2 #define STAN_MATH_PRIM_MAT_FUN_SIMPLEX_CONSTRAIN_HPP 29 const Eigen::Matrix<T, Eigen::Dynamic, 1>& y) {
37 Matrix<T, Dynamic, 1> x(Km1 + 1);
39 for (size_type k = 0; k < Km1; ++k) {
41 x(k) = stick_len * z_k;
63 const Eigen::Matrix<T, Eigen::Dynamic, 1>& y, T& lp) {
71 Matrix<T, Dynamic, 1> x(Km1 + 1);
73 for (size_type k = 0; k < Km1; ++k) {
74 double eq_share = -
log(Km1 - k);
75 T adj_y_k(y(k) + eq_share);
77 x(k) = stick_len * z_k;
fvar< T > log(const fvar< T > &x)
fvar< T > inv_logit(const fvar< T > &x)
Returns the inverse logit function applied to the argument.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic >::Index size_type
Type for sizes and indexes in an Eigen matrix with double e.
Primary template class for the metaprogram to compute the index type of a container.
fvar< T > log1p_exp(const fvar< T > &x)
Eigen::Matrix< T, Eigen::Dynamic, 1 > simplex_constrain(const Eigen::Matrix< T, Eigen::Dynamic, 1 > &y)
Return the simplex corresponding to the specified free vector.