Stan Math Library
5.0.0
Automatic Differentiation
|
double stan::math::opencl_kernels::inv_logit | ( | double | x | ) |
Returns the inverse logit function applied to the kernel generator expression.
The inverse logit function is defined by
\(\mbox{logit}^{-1}(x) = \frac{1}{1 + \exp(-x)}\).
This function can be used to implement the inverse link function for logistic regression.
The inverse to this function is logit
.
\[ \mbox{inv\_logit}(y) = \begin{cases} \mbox{logit}^{-1}(y) & \mbox{if } -\infty\leq y \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{inv\_logit}(y)}{\partial y} = \begin{cases} \frac{\partial\, \mbox{logit}^{-1}(y)}{\partial y} & \mbox{if } -\infty\leq y\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } y = \textrm{NaN} \end{cases} \]
\[ \mbox{logit}^{-1}(y) = \frac{1}{1 + \exp(-y)} \]
\[ \frac{\partial \, \mbox{logit}^{-1}(y)}{\partial y} = \frac{\exp(y)}{(\exp(y)+1)^2} \]
[in] | x | Argument. |
Definition at line 57 of file inv_logit.hpp.