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

◆ offset_multiplier_constrain() [1/14]

template<typename T , typename M , typename S , require_all_kernel_expressions_t< T, M, S > * = nullptr, require_any_not_stan_scalar_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 unconstrained input
Mtype of offset
Stype of multiplier
Parameters
[in]xUnconstrained 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 38 of file offset_multiplier_constrain.hpp.