betapdf

 

Description

Probability density function for the beta distribution

Syntax

double betapdf( const double x, double a, double b, int * nFail = NULL )

Parameters

x
[input] the value of the beta variate, 0.0 \le x \le 1.0
a
[input] the first shape parameter, a, of the required beta distribution
b
[input] the second shape parameter, b, of the required beta distribution
nFail
[output] fail code

Return

Return the probability density for the beta distribution

Examples

EX1

void betapdf_ex1()
{
        double x[]= {0.25, 0.5, 0.75};
        double a = 1.0, b =2.0;
        for(int ii = 0; ii<3; ii++)
                printf("%f     %f      %f:     %f\n", x[ii], a, b, betapdf(x[ii], a, b));
}

Remark

See Also

betacdf

header to Include

origin.h

Reference