Beta distribution with parameters α, β > 0 when x ϵ [0, 1] is described by probability density function:
Where Г - gamma function that looks as follows:
This distribution uses a general method of generating random variables with the distribution X ~ B(α, β) for any values of α > 0 and β > 0, based on the fact that if two independent random variables follow gamma distribution Y1 ~ Г(α, 1), Y2 ~ Г(β, 1), the value Y1 / (Y1 + Y2) ~ B(α, β) follows beta distribution. The algorithm includes the following steps:
1. Independently generate two pseudo-random samples of gamma distribution Y1 ~ Г(α, 1), Y2 ~ Г(β, 1).
2. Calculate value X = Y1 / (Y1 + Y2).
See also: