Learn R Programming

Runuran (version 0.40)

udbeta: UNU.RAN object for Beta distribution

Description

Create UNU.RAN object for a Beta distribution with with parameters shape1 and shape2.

[Distribution] -- Beta.

Usage

udbeta(shape1, shape2, lb=0, ub=1)

Value

An object of class "unuran.cont".

Arguments

shape1,shape2

positive shape parameters of the Beta distribution.

lb

lower bound of (truncated) distribution.

ub

upper bound of (truncated) distribution.

Author

Josef Leydold and Wolfgang H\"ormann unuran@statmath.wu.ac.at.

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 domain of the distribution can be truncated to the interval (lb,ub).

References

N.L. Johnson, S. Kotz, and N. Balakrishnan (1995): Continuous Univariate Distributions, Volume 2. 2nd edition, John Wiley & Sons, Inc., New York. Chap. 25, p. 210.

See Also

unuran.cont.

Examples

Run this code
## Create distribution object for beta distribution
distr <- udbeta(shape1=3,shape2=7)
## Generate generator object; use method PINV (inversion)
gen <- pinvd.new(distr)
## Draw a sample of size 100
x <- ur(gen,100)

Run the code above in your browser using DataLab