Class Cheng1978
java.lang.Object
dev.nm.stat.random.rng.univariate.beta.Cheng1978
- All Implemented Interfaces:
RandomBetaGenerator
,RandomNumberGenerator
,Seedable
Cheng, 1978, is a new rejection method for generating beta variates. The
method is compared with previously published methods both theoretically and
through computer timings. It is suggested that the method has advantages in
both speed and programming simplicity over previous methods, especially for
"difficult" combinations of parameter values.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCheng1978
(double aa, double bb) Constructs a random number generator to sample from the beta distribution.Cheng1978
(double aa, double bb, RandomLongGenerator uniform) Constructs a random number generator to sample from the beta distribution. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Get the next randomdouble
.void
seed
(long... seeds) Seed the random number/vector/scenario generator to produce repeatable experiments.
-
Constructor Details
-
Cheng1978
Constructs a random number generator to sample from the beta distribution.- Parameters:
aa
- the degree of freedombb
- the degree of freedomuniform
- a uniform random number generator
-
Cheng1978
public Cheng1978(double aa, double bb) Constructs a random number generator to sample from the beta distribution.- Parameters:
aa
- the degree of freedombb
- the degree of freedom
-
-
Method Details
-
seed
public void seed(long... seeds) Description copied from interface:Seedable
Seed the random number/vector/scenario generator to produce repeatable experiments. -
nextDouble
public double nextDouble()Description copied from interface:RandomNumberGenerator
Get the next randomdouble
.- Specified by:
nextDouble
in interfaceRandomNumberGenerator
- Returns:
- the next random number
-