udbeta | R Documentation |
Create UNU.RAN object for a Beta distribution with
with parameters shape1
and shape2
.
[Distribution] – Beta.
udbeta(shape1, shape2, lb=0, ub=1)
shape1 , shape2 |
positive shape parameters of the Beta distribution. |
lb |
lower bound of (truncated) distribution. |
ub |
upper bound of (truncated) distribution. |
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
).
An object of class "unuran.cont"
.
Josef Leydold and Wolfgang H\"ormann unuran@statmath.wu.ac.at.
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.
unuran.cont
.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.