Loading [MathJax]/extensions/TeX/AMSsymbols.js
Automatic Differentiation
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches

◆ positive_constrain() [3/3]

template<bool Jacobian, typename T , typename Lp , require_not_std_vector_t< T > * = nullptr, require_convertible_t< return_type_t< T >, Lp > * = nullptr>
auto stan::math::positive_constrain ( const T &  x,
Lp &  lp 
)
inline

Return the positive value for the specified unconstrained input.

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
TA type inheriting from Eigen::EigenBase, a var_value with inner type inheriting from Eigen::EigenBase, a standard vector, or a scalar
LpA scalar type for the lp argument. The scalar type of T should be convertable to this.
Parameters
xunconstrained value or container
[in,out]lplog density accumulator
Returns
positive constrained version of unconstrained value(s)

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
TA standard vector with inner type inheriting from Eigen::EigenBase, a var_value with inner type inheriting from Eigen::EigenBase, a standard vector, or a scalar
LpA scalar type for the lp argument. The scalar type of T should be convertable to this.
Parameters
xunconstrained value or container
[in,out]lplog density accumulator
Returns
positive constrained version of unconstrained value(s)

Definition at line 69 of file positive_constrain.hpp.