public class Gamma extends AbstractContinousDistribution
Constructor and Description |
---|
Gamma(double alpha,
double rate,
Random randomGenerator)
Constructs a Gamma distribution with a given shape (alpha) and rate (beta).
|
Modifier and Type | Method and Description |
---|---|
double |
cdf(double x)
Returns the cumulative distribution function.
|
static double |
logGamma(double x)
Returns a quick approximation of log(gamma(x)).
|
double |
nextDouble()
Returns a random number from the distribution.
|
double |
nextDouble(double alpha,
double rate)
Returns a random number from the distribution; bypasses the internal state.
|
double |
pdf(double x)
Returns the probability distribution function.
|
String |
toString() |
nextInt
apply, apply, getRandomGenerator, randomDouble, setRandomGenerator
isDensifying
public Gamma(double alpha, double rate, Random randomGenerator)
alpha
- The shape parameter.rate
- The rate parameter.randomGenerator
- The random number generator that generates bits for us.IllegalArgumentException
- if alpha <= 0.0 || alpha <= 0.0.public double cdf(double x)
cdf
in class AbstractContinousDistribution
x
- The end-point where the cumulation should end.public double nextDouble()
nextDouble
in class AbstractDistribution
public double nextDouble(double alpha, double rate)
alpha
- Shape parameter.rate
- Rate parameter (=1/scale).public double pdf(double x)
pdf
in class AbstractContinousDistribution
x
- Where to compute the density function.public static double logGamma(double x)
Copyright © 2008–2017 The Apache Software Foundation. All rights reserved.