Main Content

betapdf

Beta probability density function

Syntax

Y = betapdf(X,A,B)

Description

Y = betapdf(X,A,B)computes the beta pdf at each of the values inXusing the corresponding parameters inAandB.X,A, andBcan be vectors, matrices, or multidimensional arrays that all have the same size. A scalar input is expanded to a constant array with the same dimensions of the other inputs. The parameters inAandBmust all be positive, and the values inXmust lie on the interval[0, 1].

The beta probability density function for a given valuex鉴于两个参数aandbis

y = f ( x | a , b ) = 1 B ( a , b ) x a 1 ( 1 x ) b 1 I [ 0 , 1 ] ( x )

whereB( · ) is the Beta function. The uniform distribution on (0 1) is a degenerate case of the beta pdf wherea= 1 andb= 1.

Alikelihood functionis the pdf viewed as a function of the parameters. Maximum likelihood estimators (MLEs) are the values of the parameters that maximize the likelihood function for a fixed value ofx.

Examples

a = [0.5 1; 2 4] a = 0.5000 1.0000 2.0000 4.0000 y = betapdf(0.5,a,a) y = 0.6366 1.0000 1.5000 2.1875

Extended Capabilities

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

Version History

Introduced before R2006a