aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/SpecialFunctions
diff options
context:
space:
mode:
authorGravatar Michael Figurnov <mfigurnov@google.com>2018-06-06 18:49:26 +0100
committerGravatar Michael Figurnov <mfigurnov@google.com>2018-06-06 18:49:26 +0100
commit4bd158fa37b4bba74e6421575d5c69eeea547172 (patch)
tree940bd1497831563a1792aea863ce9e2a9afd0b45 /unsupported/Eigen/SpecialFunctions
parente206f8d4a401fe2060bada4d4b5d92e3bf3b561c (diff)
Derivative of the incomplete Gamma function and the sample of a Gamma random variable.
In addition to igamma(a, x), this code implements: * igamma_der_a(a, x) = d igamma(a, x) / da -- derivative of igamma with respect to the parameter * gamma_sample_der_alpha(alpha, sample) -- reparameterization derivative of a Gamma(alpha, 1) random variable sample with respect to the alpha parameter The derivatives are computed by forward mode differentiation of the igamma(a, x) code. Although gamma_sample_der_alpha can be implemented via igamma_der_a, a separate function is more accurate and efficient due to analytical cancellation of some terms. All three functions are implemented by a method parameterized with "mode" that always computes the derivatives, but does not return them unless required by the mode. The compiler is expected to (and, based on benchmarks, does) skip the unnecessary computations depending on the mode.
Diffstat (limited to 'unsupported/Eigen/SpecialFunctions')
-rw-r--r--unsupported/Eigen/SpecialFunctions2
1 files changed, 2 insertions, 0 deletions
diff --git a/unsupported/Eigen/SpecialFunctions b/unsupported/Eigen/SpecialFunctions
index 482ec6e6f..9441ba8f5 100644
--- a/unsupported/Eigen/SpecialFunctions
+++ b/unsupported/Eigen/SpecialFunctions
@@ -29,6 +29,8 @@ namespace Eigen {
* - erfc
* - lgamma
* - igamma
+ * - igamma_der_a
+ * - gamma_sample_der_alpha
* - igammac
* - digamma
* - polygamma