<< Support Support distfun_erfcinv >>

distfun >> distfun > Support > distfun_betainc

distfun_betainc

Regularized Incomplete Beta function

Calling Sequence

y = distfun_betainc(x,z,w)
y = distfun_betainc(x,z,w,lowertail)

Parameters

x :

a matrix of doubles, the outcome. Should be in the [0,1] interval. If not, an error is generated.

z :

a matrix of doubles, the first shape parameter, z>=0.

w :

a matrix of doubles, the second shape parameter, w>=0.

lowertail :

a 1-by-1 matrix of booleans, the tail (default lowertail=%t). If lowertail is true (the default), then computes the integral from 0 to x otherwise from x to 1.

y :

a matrix of doubles, the output, y in [0,1].

Description

Computes the regularized Incomplete Beta function.

The Beta function is defined by

\begin{eqnarray}
B(z,w) = \int_0^1 t^{z-1} (1-t)^{w-1} dt = \frac{\Gamma(z)\Gamma(w)}{\Gamma(z+w)}
\end{eqnarray}

The incomplete Beta function is defined by

\begin{eqnarray}
B(x,z,w) = \int_0^x t^{z-1} (1-t)^{w-1} dt
\end{eqnarray}

if x is in [0,1].

The (lower tail) regularized incomplete Beta function is defined by

\begin{eqnarray}
I_x(z,w) = \frac{B(x,z,w)}{B(z,w)}
\end{eqnarray}

if x is in [0,1].

The upper tail regularized incomplete Beta function is defined by

\begin{eqnarray}
I_x^u(z,w) = \frac{B^u(x,z,w)}{B(z,w)}
\end{eqnarray}

if x is in [0,1] where the upper tail of the incomplete Beta function is

\begin{eqnarray}
B^u(x,z,w) = \int_x^1 t^{z-1} (1-t)^{w-1} dt.
\end{eqnarray}

The sum of the lower and upper tail is equal to 1 :

\begin{eqnarray}
I_x(z,w) + I_x^u(z,w) = 1
\end{eqnarray}

Examples

distfun_betainc(.5,(0:10)',3)

// Plot the function
z = 1;
w = 2;
x=linspace(0,1,100);
y = distfun_betainc(x,z,w);
plot(x,y)
xtitle("Regularized Incomplete Beta Function, z=1, w=2","x","Ix(z,w)");

Authors


Report an issue
<< Support Support distfun_erfcinv >>