Return the lower and upper-bounded scalar derived by transforming the specified free scalar given the specified lower and upper bounds.
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
-
Jacobian | if true , increment log density accumulator with log absolute Jacobian determinant of constraining transform |
T | A type inheriting from Eigen::EigenBase , a var_value with inner type inheriting from Eigen::EigenBase , a standard vector, or a scalar |
L | A type inheriting from Eigen::EigenBase , a var_value with inner type inheriting from Eigen::EigenBase , a standard vector, or a scalar |
U | A type inheriting from Eigen::EigenBase , a var_value with inner type inheriting from Eigen::EigenBase , a standard vector, or a scalar |
- Parameters
-
[in] | x | Free scalar to transform |
[in] | lb | Lower bound |
[in] | ub | Upper bound |
[in,out] | lp | log density accumulator |
- Returns
- Lower- and upper-bounded scalar derived from transforming the free scalar
- Exceptions
-
std::domain_error | if ub <= lb |
Definition at line 395 of file lub_constrain.hpp.