Class ChengBetaSampler

    • Field Detail

      • LN_4

        private static final double LN_4
        Natural logarithm of 4.
    • Constructor Detail

      • ChengBetaSampler

        public ChengBetaSampler​(UniformRandomProvider rng,
                                double alpha,
                                double beta)
        Creates a sampler instance.
        Parameters:
        rng - Generator of uniformly distributed random numbers.
        alpha - Distribution first shape parameter.
        beta - Distribution second shape parameter.
        Throws:
        java.lang.IllegalArgumentException - if alpha <= 0 or beta <= 0
    • Method Detail

      • sample

        public double sample()
        Creates a double sample.
        Specified by:
        sample in interface ContinuousSampler
        Returns:
        a sample.
      • of

        public static SharedStateContinuousSampler of​(UniformRandomProvider rng,
                                                      double alpha,
                                                      double beta)
        Creates a new beta distribution sampler.
        Parameters:
        rng - Generator of uniformly distributed random numbers.
        alpha - Distribution first shape parameter.
        beta - Distribution second shape parameter.
        Returns:
        the sampler
        Throws:
        java.lang.IllegalArgumentException - if alpha <= 0 or beta <= 0
        Since:
        1.3