Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ lub_constrain() [5/22]

template<typename T , typename L , typename U , require_all_stan_scalar_t< T, L, U > * = nullptr, require_not_var_t< return_type_t< T, L, U > > * = nullptr>
auto stan::math::lub_constrain ( T &&  x,
L &&  lb,
U &&  ub 
)
inline

Return the lower and upper-bounded scalar derived by transforming the specified free scalar given the specified lower and upper bounds.

The transform is the transformed and scaled inverse logit,

\(f(x) = L + (U - L) \mbox{logit}^{-1}(x)\)

Template Parameters
TScalar.
LScalar.
UScalar.
Parameters
[in]xFree scalar to transform.
[in]lbLower bound.
[in]ubUpper bound.
Returns
Lower- and upper-bounded scalar derived from transforming the free scalar.
Exceptions
std::domain_errorif ub <= lb

Definition at line 47 of file lub_constrain.hpp.