1 #ifndef STAN_MATH_PRIM_MAT_FUN_SIMPLEX_CONSTRAIN_HPP 2 #define STAN_MATH_PRIM_MAT_FUN_SIMPLEX_CONSTRAIN_HPP 28 Eigen::Matrix<T, Eigen::Dynamic, 1>
37 Matrix<T, Dynamic, 1> x(Km1 + 1);
39 for (size_type k = 0; k < Km1; ++k) {
41 x(k) = stick_len * z_k;
62 Eigen::Matrix<T, Eigen::Dynamic, 1>
72 Matrix<T, Dynamic, 1> x(Km1 + 1);
74 for (size_type k = 0; k < Km1; ++k) {
75 double eq_share = -
log(Km1 - k);
76 T adj_y_k(y(k) + eq_share);
78 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.