Automatic Differentiation
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches

◆ simplex_constrain() [3/6]

template<typename T , require_std_vector_t< T > * = nullptr>
auto stan::math::simplex_constrain ( const T &  y)
inline

Return the simplex corresponding to the specified free vector.

This overload handles looping over the elements of a standard vector.

Template Parameters
VecA standard vector with inner type inheriting from Eigen::DenseBase or a var_value with inner type inheriting from Eigen::DenseBase with compile time dynamic rows and 1 column
Parameters
[in]yfree vector
Returns
simplex of dimensionality one greater than y

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
TType of vector to constrain
Parameters
yFree vector input of dimensionality K - 1
Returns
Simplex of dimensionality K

Definition at line 98 of file simplex_constrain.hpp.