
public final class GammaDistribution extends Object implements Distribution
| Modifier and Type | Field and Description |
|---|---|
private double |
k
Alpha == k
|
private Random |
random
The random generator.
|
private double |
theta
Theta == 1 / Beta
|
| Constructor and Description |
|---|
GammaDistribution(double k,
double theta,
Random random)
Constructor for Gamma distribution generator
|
| Modifier and Type | Method and Description |
|---|---|
double |
explain(double val)
Return the PDF of the generators distribution
|
double |
generate()
Generate a random value with the generators parameters.
|
double |
getK() |
double |
getTheta() |
static double |
pdf(double x,
double k,
double theta)
Gamma distribution PDF (with 0.0 for x < 0)
|
String |
toString()
Simple toString explaining the distribution parameters.
|
private final double k
private final double theta
private Random random
public GammaDistribution(double k,
double theta,
Random random)
k - k, alpha aka. "shape" parametertheta - Theta = 1.0/Beta aka. "scaling" parameterrandom - Random generatorpublic static double pdf(double x,
double k,
double theta)
x - query valuek - Alphatheta - Thetha = 1 / Betapublic double explain(double val)
explain in interface Distributionval - existing valuepublic double generate()
generate in interface Distributionpublic String toString()
toString in interface DistributiontoString in class Objectpublic double getK()
public double getTheta()