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

◆ offset_multiplier_constrain() [6/15]

template<typename T , typename M , typename S , typename Lp , require_convertible_t< return_type_t< T, M, S >, Lp > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T, M, S > * = nullptr>
auto stan::math::offset_multiplier_constrain ( const T &  x,
const M &  mu,
const S &  sigma,
Lp &  lp 
)
inline

Return the linearly transformed value for the specified unconstrained input and specified offset and multiplier, incrementing the specified reference with the log absolute Jacobian determinant of the transform.

The transform applied is

\(f(x) = mu + sigma * x\)

where mu is the offset and sigma is the multiplier.

If the offset is zero and multiplier is one, this function reduces to identity_constraint(x, lp).

Template Parameters
Ttype of scalar
Mtype of offset
Stype of multiplier
LpScalar type, convertable from T, M, and S
Parameters
[in]xUnconstrained scalar input
[in]muoffset of constrained output
[in]sigmamultiplier of constrained output
[in,out]lpReference to log probability to increment.
Returns
linear transformed value corresponding to inputs
Exceptions
std::domain_errorif sigma <= 0
std::domain_errorif mu is not finite

Definition at line 96 of file offset_multiplier_constrain.hpp.