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

◆ offset_multiplier_constrain() [5/14]

template<typename T , typename M , typename S , 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 
)
inline

Return the linearly transformed value for the specified unconstrained input and specified offset and multiplier.

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 the multiplier is one this reduces to identity_constrain(x).

Template Parameters
Ttype of scalar
Mtype of offset
Stype of multiplier
Parameters
[in]xUnconstrained scalar input
[in]muoffset of constrained output
[in]sigmamultiplier of constrained output
Returns
linear transformed value corresponding to inputs
Exceptions
std::domain_errorif sigma <= 0
std::domain_errorif mu is not finite

Definition at line 44 of file offset_multiplier_constrain.hpp.