Class NegativeBinomialRV

    • Constructor Detail

      • NegativeBinomialRV

        public NegativeBinomialRV​(double prob,
                                  double numSuccess)
        Parameters:
        prob - the probability of success, must be in (0,1)
        numSuccess - number of trials until rth success
      • NegativeBinomialRV

        public NegativeBinomialRV​(double prob,
                                  double numSuccess,
                                  int streamNum)
        Parameters:
        prob - the probability of success, must be in (0,1)
        numSuccess - number of trials until rth success
        streamNum - the stream number from the stream provider to use
      • NegativeBinomialRV

        public NegativeBinomialRV​(double prob,
                                  double numSuccess,
                                  RNStreamIfc stream)
        Parameters:
        prob - the probability of success, must be in (0,1)
        numSuccess - number of trials until rth success
        stream - the stream from the stream provider to use
    • Method Detail

      • newInstance

        public NegativeBinomialRV newInstance​(RNStreamIfc stream)
        Parameters:
        stream - the random number stream to use
        Returns:
        a new instance with same parameter value
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getProbabilityOfSuccess

        public double getProbabilityOfSuccess()
        Gets the success probability
        Returns:
        The success probability
      • getDesiredNumberOfSuccesses

        public double getDesiredNumberOfSuccesses()
        Gets the desired number of successes
        Returns:
        the number of success
      • generate

        protected double generate()
        Specified by:
        generate in class AbstractRVariable
        Returns:
        the randomly generated variate
      • makeControls

        public static RVControls makeControls()
        The keys are "ProbOfSuccess", the default value is 0.5 and "NumSuccesses" with default value 1.
        Returns:
        a control for Negative Binomial random variables