Skip to main content

Welcome

This tiny library contains some C/Cython code for calculating

  • the (normalized) incomplete Beta function - betainc
  • the first derivatives (w.r.t. shape parameters) of the incomplete Beta function via the INBEDER algorithm
  • the digamma (Psi) function, the beta function and its logarithm (betaln)

API

  • beta(p, q): Calculate the Beta function, where B(p,q) = Gamma(p)*Gamma(q)/Gamma(p+q)
  • betaln(p, q): Calculate the logarithm of the Beta function, where betaln(p,q) = ln B(p,q) = ln Gamma(p) + ln Gamma(q) - ln Gamma(p+q)
  • betainc(x, p, q): Calculate the regularized incomplete Beta function, where betainc(x, p, q) = I_x(p, q). See http://mathworld.wolfram.com/IncompleteBetaFunction.html
  • betaincderp(x, p, q): Compute the first derivative of the regularized incomplete Beta function with respect to the first shape parameter p.
  • betaincderq(x, p, q): First derivative of the regularized incomplete Beta function with respect to the second shape parameter q.
  • digamma(x): The digamma function. See http://mathworld.wolfram.com/DigammaFunction.html.

Installation

$ pip install betaincder

Usage

The functions can be invoked from python, or cimported from Cython.

from betaincder import betainc, betaincderp, betaincderq
print betaincderq(.5, 10, 10)

or

%%cython 
from betaincder.c.betaincder cimport digamma, betaln, betainc, betaincderq
print betaincderq(.5, 10, 10)

References

  • Robinson-Cox, J. F., & Boik, R. J. (1998). Derivatives of the Incomplete Beta Function. Journal of Statistical Software, 3(01).
  • Bernardo, Jose M. "Algorithm AS 103: Psi (digamma) function." Journal of the Royal Statistical Society. Series C (Applied Statistics) 25.3 (1976): 315-317.

Metadata

Release files for betaincder 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for betaincder 0.1.1
File Size Uploaded
betaincder-0.1.1.tar.gz 27.3 kB Details

Release files / betaincder-0.1.1.tar.gz

Download URL betaincder-0.1.1.tar.gz
Size 27.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9ffa671b631ba93746b042058aba633983eae2a21890ca898b3ee7f02df278ac
BLAKE2b-256 checksum
How to use checksums
a4a5a5b88234e5d145e7cb05251f1c026fa7e718f0e4bb8945238e57079aaacd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.14

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page