/** * Constructs a Gamma distribution with a given shape (alpha) and rate (beta). * * @param alpha The shape parameter. * @param rate The rate parameter. * @param randomGenerator The random number generator that generates bits for us. * @throws IllegalArgumentException if <tt>alpha <= 0.0 || alpha <= 0.0</tt>. */ public Gamma(double alpha, double rate, Random randomGenerator) { this.alpha = alpha; this.rate = rate; setRandomGenerator(randomGenerator); }
/** * Sets the uniform random generator internally used. * * @param rand the new PRNG */ @Override public void setRandomGenerator(Random rand) { gAlpha.setRandomGenerator(rand); gBeta.setRandomGenerator(rand); } }
/** * Constructs a Gamma distribution with a given shape (alpha) and rate (beta). * * @param alpha The shape parameter. * @param rate The rate parameter. * @param randomGenerator The random number generator that generates bits for us. * @throws IllegalArgumentException if <tt>alpha <= 0.0 || alpha <= 0.0</tt>. */ public Gamma(double alpha, double rate, Random randomGenerator) { this.alpha = alpha; this.rate = rate; setRandomGenerator(randomGenerator); }
/** * Constructs a Gamma distribution with a given shape (alpha) and rate (beta). * * @param alpha The shape parameter. * @param rate The rate parameter. * @param randomGenerator The random number generator that generates bits for us. * @throws IllegalArgumentException if <tt>alpha <= 0.0 || alpha <= 0.0</tt>. */ public Gamma(double alpha, double rate, Random randomGenerator) { this.alpha = alpha; this.rate = rate; setRandomGenerator(randomGenerator); }