Stan Math Library
5.0.0
Automatic Differentiation
|
|
inline |
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.
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 98 of file lub_constrain.hpp.