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

◆ corr_constrain() [2/3]

template<typename T_x , typename T_lp >
auto stan::math::corr_constrain ( const T_x &  x,
T_lp &  lp 
)
inline

Return the result of transforming the specified scalar or container of values to have a valid correlation value between -1 and 1 (inclusive).

The transform used is as specified for corr_constrain(T). The log absolute Jacobian determinant is

\(\log | \frac{d}{dx} \tanh x | = \log (1 - \tanh^2 x)\).

Template Parameters
T_xType of scalar or container
Parameters
[in]xvalue or container
[in,out]lplog density accumulator

Definition at line 46 of file corr_constrain.hpp.