UNU.RAN random variate generator for the Beta distribution with
parameters shape1 and shape2.
It also allows sampling from the truncated distribution.
[Special Generator] -- Sampling Function: Beta.
Usage
urbeta(n, shape1, shape2, lb = 0, ub = 1)
Arguments
n
size of required sample.
shape1,shape2
positive shape parameters of the Beta distribution.
lb
lower bound of (truncated) distribution.
ub
upper bound of (truncated) distribution.
Details
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).
References
W. H"ormann, J. Leydold, and G. Derflinger (2004):
Automatic Nonuniform Random Variate Generation.
Springer-Verlag, Berlin Heidelberg
See Also
runif and .Random.seed about random number
generation, unuran for the UNU.RAN class, and
rbeta for the Rbuilt-in generator.