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

◆ lub_free() [1/7]

template<typename T , typename L , typename U , require_not_std_vector_t< T > * = nullptr, require_all_stan_scalar_t< L, U > * = nullptr>
auto stan::math::lub_free ( T &&  y,
L &&  lb,
U &&  ub 
)
inline

lub_free Return the unconstrained variable that transforms to the y given the specified bounds.

Overload for matrix constrained variable, matrix upper bound, scalar lower bound.

Overload for matrix constrained variable, matrix lower bound, scalar upper bound.

The transform in lub_constrain, is reversed by a transformed and scaled logit,

\(f^{-1}(y) = \mbox{logit}(\frac{y - L}{U - L})\)

where \(U\) and \(L\) are the lower and upper bounds.

Template Parameters
Ttype of bounded object
Ltype of lower bound
Utype of upper bound
Parameters
yconstrained value
lblower bound
ubupper bound
Returns
the free object that transforms to the input given the bounds
Exceptions
std::invalid_argumentif the lower bound is greater than the upper bound, y is less than the lower bound, or y is greater than the upper bound Overload for all scalar arguments

Definition at line 46 of file lub_free.hpp.