View source code Display the source code in std/mathspecial.d from which this page was generated on github. Improve this page Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone. Page wiki View or edit the community-maintained wiki page associated with this page.

Function std.mathspecial.betaIncomplete

Incomplete beta integral

Returns incomplete beta integral of the arguments, evaluated from zero to x. The regularized incomplete beta function is defined as

betaIncomplete(a, b, x) = γ(a + b) / ( γ(a) γ(b) ) * 0, x t, a-1(1-t), b-1 dt

and is the same as the the cumulative distribution function.

The domain of definition is 0 <= x <= 1. In this implementation a and b are restricted to positive values. The integral from x to 1 may be obtained by the symmetry relation

betaIncompleteCompl(a, b, x ) = betaIncomplete( b, a, 1-x )

The integral is evaluated by a continued fraction expansion or, when b * x is small, by a power series.

Prototype

real betaIncomplete(
  real a,
  real b,
  real x
) pure nothrow @nogc @safe;

Authors

Stephen L. Moshier (original C code). Conversion to D by Don Clugston

License

Boost License 1.0.

Comments