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

◆ unit_vector_constrain() [11/11]

template<typename T , require_eigen_col_vector_vt< is_var, T > * = nullptr>
auto stan::math::unit_vector_constrain ( const T &  y,
var lp 
)
inline

Return the unit length vector corresponding to the free vector y.

See https://en.wikipedia.org/wiki/N-sphere#Generating_random_points

Template Parameters
EigMattype inheriting from EigenBase that has a var scalar type.
Parameters
yvector of K unrestricted variables
Returns
Unit length vector of dimension K
Parameters
lpLog probability reference to increment.

Definition at line 61 of file unit_vector_constrain.hpp.