Skip to main content

betainc

Function betainc 

Source
pub fn betainc(a: f64, b: f64, x: f64) -> f64
Expand description

Regularized incomplete Beta function $\I_x(a,b)$

Computes the regularized incomplete Beta function, defined as 1:

$$ \I_x(a,b) = {\Gamma(a+b) \over \Gamma(a)\Gamma(b)} \int_0^x t^{a-1} (1-t)^{b-1} \dd t = {\B_x(a,b) \over \B(a,b)} , $$

for $0 \le x \le 1$, with $\B$ the Beta function, and $\B_x$ the (non-regularized) incomplete Beta function.

§Notes

This function uses the incbet Cephes routine 2, making it less accurate than scipy.special.betainc, which wraps the Boost ibeta routine 3. Especially for small x the accuracy may be poor.

§See also

  • betaincinv: Inverse of the regularized incomplete Beta function
  • betaincc: Complement of the regularized incomplete Beta function
  • beta: Beta function $\B(a, b)$
  • gamma: Gamma function $\Gamma(x)$
  • scipy.special.betainc: Corresponding function in SciPy

  1. NIST Digital Library of Mathematical Functions, https://dlmf.nist.gov/8.17. ↩

  2. Cephes Math Library Release 2.3. ↩

  3. The Boost Developers. “Boost C++ Libraries”, https://www.boost.org. ↩