Class XiTanLiu2010b

  • All Implemented Interfaces:
    RandomGammaGenerator, RandomNumberGenerator, Seedable

    public class XiTanLiu2010b
    extends Object
    implements RandomGammaGenerator
    Xi, Tan and Liu proposed two simple algorithms to generate gamma random numbers based on the ratio-of-uniforms method and logarithmic transformations of gamma random variable. This implementation is Algorithm 4.1 in the reference. It restricts the range of the shape parameter to be equal to or less than 1. It, however, assumes the scale parameter is always 1. Note that for when the shape parameter < 0.01, it returns numbers in logarithmic scale. Take exp to convert.
    • Constructor Detail

      • XiTanLiu2010b

        public XiTanLiu2010b​(double k,
                             RandomLongGenerator uniform)
        Construct a random number generator to sample from the gamma distribution.
        Parameters:
        k - the shape parameter
        uniform - a uniform random number generator
      • XiTanLiu2010b

        public XiTanLiu2010b​(double k)
        Construct a random number generator to sample from the gamma distribution.
        Parameters:
        k - the shape parameter
    • 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