Main Content

betainv

Beta inverse cumulative distribution function

Syntax

X = betainv(P,A,B)

Description

X = betainv(P,A,B)computes the inverse of the beta cdf with parameters specified byAandB中相应的概率P.P,A, andBcan be vectors, matrices, or multidimensional arrays that are all the same size. A scalar input is expanded to a constant array with the same dimensions as the other inputs. The parameters inAandBmust all be positive, and the values inPmust lie on the interval [0, 1].

The inverse beta cdf for a given probabilitypand a given pair of parametersaandbis

x = F 1 ( p | a , b ) = { x : F ( x | a , b ) = p }

where

p = F ( x | a , b ) = 1 B ( a , b ) 0 x t a 1 ( 1 t ) b 1 d t

andB( · ) is the Beta function. Each element of outputXis the value whose cumulative probability under the beta cdf defined by the corresponding parameters inAandBis specified by the corresponding value inP.

Examples

p = [0.01 0.5 0.99]; x = betainv(p,10,5) x = 0.3726 0.6742 0.8981

According to this result, for a beta cdf witha= 10 andb= 5, a value less than or equal to 0.3726 occurs with probability 0.01. Similarly, values less than or equal to 0.6742 and 0.8981 occur with respective probabilities 0.5 and 0.99.

Algorithms

Thebetainvfunction uses Newton's method with modifications to constrain steps to the allowable range forx, i.e., [0 1].

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced before R2006a