Stan Math Library
4.9.0
Automatic Differentiation
|
Return the Gamma function applied to the specified variable (C99).
The derivative with respect to the argument is
\(\frac{d}{dx} \Gamma(x) = \Gamma(x) \Psi^{(0)}(x)\)
where \(\Psi^{(0)}(x)\) is the digamma function.
\[ \mbox{tgamma}(x) = \begin{cases} \textrm{error} & \mbox{if } x\in \{\dots, -3, -2, -1, 0\}\\ \Gamma(x) & \mbox{if } x\not\in \{\dots, -3, -2, -1, 0\}\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{tgamma}(x)}{\partial x} = \begin{cases} \textrm{error} & \mbox{if } x\in \{\dots, -3, -2, -1, 0\}\\ \frac{\partial\, \Gamma(x)}{\partial x} & \mbox{if } x\not\in \{\dots, -3, -2, -1, 0\}\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \Gamma(x)=\int_0^{\infty} u^{x - 1} \exp(-u) \, du \]
\[ \frac{\partial \, \Gamma(x)}{\partial x} = \Gamma(x)\Psi(x) \]
a | Argument to function. |
Definition at line 48 of file tgamma.hpp.