diff --git a/convoys/gamma.py b/convoys/gamma.py index 107c88f..45b8570 100644 --- a/convoys/gamma.py +++ b/convoys/gamma.py @@ -7,9 +7,12 @@ @primitive def gammainc(k, x): - ''' Janky hack to make autograd compute gradients of gammainc. + ''' Lower regularized incomplete gamma function. - There are two problems with autograd.scipy.special.gammainc: + We rely on `scipy.special.gammainc + `_ + for this. However, there is a number of issues using this function + together with `autograd `_: 1. It doesn't let you take the gradient with respect to k 2. The gradient with respect to x is really slow diff --git a/convoys/regression.py b/convoys/regression.py index 8006cb7..680c225 100644 --- a/convoys/regression.py +++ b/convoys/regression.py @@ -76,9 +76,10 @@ class GeneralizedGamma(RegressionModel): :math:`F(t) = P(k, (t\\lambda)^p)` - where :math:`P(a, x) = \\gamma(a, x) / \\Gamma(a)` is the `lower regularized - incomplete gamma function - `_. + where :math:`P(a, x) = \\gamma(a, x) / \\Gamma(a)` is the lower regularized + incomplete gamma function. See :meth:`convoys.gamma.gammainc`. + :math:`\\gamma(a, x)` is the incomplete gamma function and :math:`\\Gamma(a)` + is the standard gamma function. The probability density function is: @@ -336,9 +337,8 @@ class Gamma(GeneralizedGamma): :math:`F(t) = P(k, t\\lambda)` - where :math:`P(a, x) = \\gamma(a, x) / \\Gamma(a)` is the `lower regularized - incomplete gamma function - `_. + where :math:`P(a, x) = \\gamma(a, x) / \\Gamma(a)` is the lower regularized + incomplete gamma function. See :meth:`convoys.gamma.gammainc`. The probability density function is: