Class DistBeta

    • Constructor Detail

      • DistBeta

        public DistBeta​(StreamInterface stream,
                        double alpha1,
                        double alpha2)
        constructs a new beta distribution.
        Parameters:
        stream - StreamInterface; the stream.
        alpha1 - double; the first shape parameter α1 for the distribution
        alpha2 - double; the second shape parameter α2for the distribution
        Throws:
        IllegalArgumentException - when alpha1 <= 0.0 or alpha2 <= 0.0
    • Method Detail

      • draw

        public double draw()
        draws the next stream value according to the probability of this this distribution.
        Specified by:
        draw in class DistContinuous
        Returns:
        the next double value drawn.
      • getProbabilityDensity

        public double getProbabilityDensity​(double x)
        returns the probability density value of a value x.
        Specified by:
        getProbabilityDensity in class DistContinuous
        Parameters:
        x - double; the value for which the density function needs to be calculated
        Returns:
        double; the probability density for value x
      • getAlpha1

        public double getAlpha1()
        Return the first shape parameter α1 for the distribution.
        Returns:
        double; the first shape parameter α1 for the distribution
      • getAlpha2

        public double getAlpha2()
        Return the second shape parameter α2for the distribution.
        Returns:
        double; the second shape parameter α2for the distribution
      • setStream

        public void setStream​(StreamInterface stream)
        Replace the random number stream.
        Overrides:
        setStream in class Dist
        Parameters:
        stream - StreamInterface; the new random number stream