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

◆ corr_constrain() [3/3]

template<bool Jacobian, 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).

If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.

Template Parameters
Jacobianif true, increment log density accumulator with log absolute Jacobian determinant of constraining transform
T_xType of scalar or container
T_lptype of target log density accumulator
Parameters
[in]xvalue or container
[in,out]lplog density accumulator

Definition at line 68 of file corr_constrain.hpp.