Class Cheng1978

  • All Implemented Interfaces:
    RandomBetaGenerator, RandomNumberGenerator, Seedable

    public class Cheng1978
    extends Object
    implements RandomBetaGenerator
    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:
    • "R. C. H. Cheng, "Generating beta variates with nonintegral shape parameters," Communications of the ACM 21, 317-322. 1978."
    • "http://svn.r-project.org/R/trunk/src/nmath/rbeta.c"
    • Constructor Detail

      • Cheng1978

        public Cheng1978​(double aa,
                         double bb,
                         RandomLongGenerator uniform)
        Constructs a random number generator to sample from the beta distribution.
        Parameters:
        aa - the degree of freedom
        bb - the degree of freedom
        uniform - 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 freedom
        bb - the degree of freedom
    • Method Detail

      • seed

        public void seed​(long... seeds)
        Description copied from interface: Seedable
        Seed the random number/vector/scenario generator to produce repeatable experiments.
        Specified by:
        seed in interface Seedable
        Parameters:
        seeds - the seeds