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

◆ lub_constrain() [1/19]

template<typename T , typename L , typename U , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr, require_all_kernel_expressions_t< L, U > * = nullptr>
matrix_cl< double > stan::math::lub_constrain ( const T &  x,
const L &  lb,
const U &  ub 
)
inline

Return the lower and upper-bounded matrix derived by transforming the specified free matrix 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
Tmatrix expression type
Llower bound expression type
Uupper bound expression type
Parameters
[in]xFree matrix to transform.
[in]lbLower bound
[in]ubUpper bound
Returns
Lower- and upper-bounded matrix derived from transforming the free matrix.
Exceptions
std::domain_errorif ub <= lb

Definition at line 35 of file lub_constrain.hpp.