Beta Random Variate



Beta Random Variate

If Ga and Gb are independent random variables, Ga having a gamma distribution with shape parameter a > 0 and Gb having a gamma distribution with shape parameter b > 0, then the random variable X = Ga / ( Ga + Gb ) has a beta distribution with shape parameters a and b. In particular the probability density for X, f(x), is:
f(x) =
0for x < 0
[ 1 / B(a,b) ] x a-1(1 - x) b-1 for 0 ≤ x ≤ 1
0for x > 1
where B(a,b) is the beta function.

Function List

  • double Beta_Random_Variate( double a, double b)

    This function returns X where X is a random variable with the density given above. Note that both a and b are positive.

Source Code

C source code is available for this routine: