Skip to content

Commit

Permalink
update some doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Bernhardsson committed Sep 6, 2018
1 parent 9900745 commit b77d491
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
7 changes: 5 additions & 2 deletions convoys/gamma.py
Expand Up @@ -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
<https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.gammainc.html>`_
for this. However, there is a number of issues using this function
together with `autograd <https://github.com/HIPS/autograd>`_:
1. It doesn't let you take the gradient with respect to k
2. The gradient with respect to x is really slow
Expand Down
12 changes: 6 additions & 6 deletions convoys/regression.py
Expand Up @@ -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
<https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.gammainc.html>`_.
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:
Expand Down Expand Up @@ -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
<https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.gammainc.html>`_.
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:
Expand Down

0 comments on commit b77d491

Please sign in to comment.