![]() |
Stan Math Library
5.1.0
Automatic Differentiation
|
|
inline |
Return the upper-bounded value for the specified unconstrained scalar and upper bound and increment the specified log probability reference with the log absolute Jacobian determinant of the transform.
Specialization of ub_constrain to apply a matrix of upper bounds elementwise to each input element.
The transform is as specified for ub_constrain(T, double). The log absolute Jacobian determinant is
\( \log | \frac{d}{dx} -\mbox{exp}(x) + U | = \log | -\mbox{exp}(x) + 0 | = x\).
| T | type of scalar |
| U | type of upper bound |
| Lp | Scalar, should be convertable from T and U |
| [in] | x | free scalar |
| [in] | ub | upper bound |
| [in,out] | lp | log density |
| T | A type inheriting from EigenBase. |
| U | A type inheriting from EigenBase. |
| Lp | Scalar, should be convertable from the scalar types of T and U. |
| [in] | x | unconstrained input |
| [in] | ub | upper bound on output |
| [in,out] | lp | reference to log probability to increment |
Definition at line 69 of file ub_constrain.hpp.