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

◆ prob_constrain() [3/3]

template<bool Jacobian, typename T >
auto stan::math::prob_constrain ( const T &  x,
T &  lp 
)
inline

Return a probability value constrained to fall between 0 and 1 (inclusive) for the specified free scalar.

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
Ttype of scalar
Parameters
[in]xunconstrained value
[in,out]lplog density accumulator
Returns
result constrained to fall in (0, 1)

Definition at line 72 of file prob_constrain.hpp.