Stan Math Library
5.0.0
Automatic Differentiation
|
|
inline |
Return the lower and upper-bounded matrix derived by transforming the specified free matrix given the specified lower and upper bounds.
Specialization for Eigen matrix and matrix bounds plus lp.
Return the lower- and upper-bounded scalar derived by transforming the specified free scalar given the specified lower and upper bounds and increment the specified log density with the log absolute Jacobian determinant.
Overload for Eigen matrix and matrix bounds plus lp.
The transform is the transformed and scaled inverse logit,
\(f(x) = L + (U - L) \mbox{logit}^{-1}(x)\)
T | matrix expression type |
L | lower bound expression type |
U | upper bound expression type |
[in] | x | Free matrix to transform. |
[in] | lb | Lower bound |
[in] | ub | Upper bound |
[in,out] | lp | Log probability scalar reference |
std::domain_error | if ub <= lb |
The transform is as defined in lub_constrain(T, double, double)
. The log absolute Jacobian determinant is given by
\(\log \left| \frac{d}{dx} \left( L + (U-L) \mbox{logit}^{-1}(x) \right) \right|\)
\( {} = \log | (U-L) \, (\mbox{logit}^{-1}(x)) \, (1 - \mbox{logit}^{-1}(x)) |\)
\( {} = \log (U - L) + \log (\mbox{logit}^{-1}(x)) + \log (1 - \mbox{logit}^{-1}(x))\)
T | Scalar. |
L | Scalar. |
U | Scalar. |
[in] | x | Free scalar to transform. |
[in] | lb | Lower bound. |
[in] | ub | Upper bound. |
[in,out] | lp | Log probability scalar reference. |
std::domain_error | if ub <= lb |
Definition at line 74 of file lub_constrain.hpp.