betainc
Regularized incomplete beta function.
Category: Mathematics > Elementary Math
Syntax
I = betainc(X, Z, W)
Returns the lower regularized incomplete beta function I_X(Z, W).
I = betainc(X, Z, W, tail)
Chooses 'lower' (default) or 'upper' tail.
Description
betainc(X, Z, W) is the integral of the beta density from 0 to X, so it is the cumulative distribution function of a beta random variable. It increases from 0 at X = 0 to 1 at X = 1. The upper tail option computes 1 - I directly and keeps accuracy when I is close to 1.
Input arguments
X- Values in the interval
[0, 1]. Z, W- Positive shape parameters.
tail'lower'or'upper'.
Output arguments
I- Values in
[0, 1]. The upper tail equals1 - lower.
Example
Cumulative beta distribution
betainc(0.5, 2, 3)
betainc(0.5, 2, 3, 'upper')
betainc(0.2, [1 2], 3)
Output
ans = 0.6875
ans = 0.3125
ans = 1×2
0.4880 0.1808