Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ simplex_constrain() [1/6]

template<typename Vec , require_eigen_vector_t< Vec > * = nullptr, require_not_st_var< Vec > * = nullptr>
plain_type_t< Vec > stan::math::simplex_constrain ( const Vec &  y)
inline

Return the simplex corresponding to the specified free vector.

A simplex is a vector containing values greater than or equal to 0 that sum to 1. A vector with (K-1) unconstrained values will produce a simplex of size K.

The transform is based on a centered stick-breaking process.

Template Parameters
Vectype of the vector
Parameters
yFree vector input of dimensionality K - 1.
Returns
Simplex of dimensionality K.

Definition at line 29 of file simplex_constrain.hpp.