Class DistGeometric

    • Constructor Detail

      • DistGeometric

        public DistGeometric​(StreamInterface stream,
                             double p)
        Construct a new geometric distribution for a repeated set of Bernoulli trials, indicating the number of failures before the first success.
        Parameters:
        stream - StreamInterface; the random number stream
        p - double; the probability of success for each individual trial
        Throws:
        IllegalArgumentException - when p <= 0 or p >= 1
    • Method Detail

      • draw

        public long draw()
        draws the next long from the stream.
        Specified by:
        draw in class DistDiscrete
        Returns:
        long
      • probability

        public double probability​(long observation)
        returns the probability of the observation in this particular distribution.
        Specified by:
        probability in class DistDiscrete
        Parameters:
        observation - long; the discrete observation.
        Returns:
        double the probability.
      • getP

        public double getP()
        Return the probability of success for each individual trial.
        Returns:
        double; the probability of success for each individual trial