The Beta distribution with parameters shape1
\(= a\) and
shape2
\(= b\) has density
$$
f(x) = \frac{\Gamma(a+b)}{\Gamma(a)\Gamma(b)}{x}^{a} {(1-x)}^{b}
$$
for \(a > 0\), \(b > 0\) and \(0 \le x \le 1\).
The generation algorithm uses fast numerical inversion. The parameters
lb
and ub
can be used to generate variates from
the Beta distribution truncated to the interval (lb
,ub
).