/** * Constructs a Negative Binomial distribution which describes the probability of getting * a particular number of negative trials (k) before getting a fixed number of positive * trials (r) where each positive trial has probability (p) of being successful. * * @param r the required number of positive trials. * @param p the probability of success. * @param randomGenerator a uniform random number generator. */ public NegativeBinomial(int r, double p, Random randomGenerator) { setRandomGenerator(randomGenerator); this.r = r; this.p = p; this.gamma = new Gamma(r, 1, randomGenerator); this.poisson = new Poisson(0.0, randomGenerator); }
/** * Constructs a Negative Binomial distribution which describes the probability of getting * a particular number of negative trials (k) before getting a fixed number of positive * trials (r) where each positive trial has probability (p) of being successful. * * @param r the required number of positive trials. * @param p the probability of success. * @param randomGenerator a uniform random number generator. */ public NegativeBinomial(int r, double p, Random randomGenerator) { setRandomGenerator(randomGenerator); this.r = r; this.p = p; this.gamma = new Gamma(r, 1, randomGenerator); this.poisson = new Poisson(0.0, randomGenerator); }
/** * Constructs a Negative Binomial distribution which describes the probability of getting * a particular number of negative trials (k) before getting a fixed number of positive * trials (r) where each positive trial has probability (p) of being successful. * * @param r the required number of positive trials. * @param p the probability of success. * @param randomGenerator a uniform random number generator. */ public NegativeBinomial(int r, double p, Random randomGenerator) { setRandomGenerator(randomGenerator); this.r = r; this.p = p; this.gamma = new Gamma(r, 1, randomGenerator); this.poisson = new Poisson(0.0, randomGenerator); }