/** * Constructs a Negative Binomial distribution. Example: n=1, p=0.5. * * @param n * the number of trials. * @param p * the probability of success. * @param randomGenerator * a uniform random number generator. */ public NegativeBinomial(int n, double p, DoubleRandomEngine randomGenerator) { setRandomGenerator(randomGenerator); setNandP(n, p); this.gamma = new Gamma(n, 1.0, randomGenerator); this.poisson = new Poisson(0.0, randomGenerator); }
/** * Constructs a Negative Binomial distribution. Example: n=1, p=0.5. * * @param n * the number of trials. * @param p * the probability of success. * @param randomGenerator * a uniform random number generator. */ public NegativeBinomial(int n, double p, DoubleRandomEngine randomGenerator) { setRandomGenerator(randomGenerator); setNandP(n, p); this.gamma = new Gamma(n, 1.0, randomGenerator); this.poisson = new Poisson(0.0, randomGenerator); }