Class DistBernoulli

    • Constructor Detail

      • DistBernoulli

        public DistBernoulli​(StreamInterface stream,
                             double p)
        constructs a new Bernoulli distribution, with p as the probability for success (X=1), where failure is associated with X=0.
        Parameters:
        stream - StreamInterface; is the stream
        p - double; the probability for success of the Bernoulli distribution
        Throws:
        IllegalArgumentException - when p < 0 or p > 1
    • Method Detail

      • 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 p, the probability for success (X=1), where failure is associated with X=0.
        Returns:
        double; p, the probability for success (X=1)