private static final class BetaDistribution.ChengBetaSampler
extends java.lang.Object
R. C. H. Cheng, "Generating beta variates with nonintegral shape parameters.". Communications of the ACM, 21, 317–322, 1978.
| Modifier | Constructor and Description |
|---|---|
private |
BetaDistribution.ChengBetaSampler() |
| Modifier and Type | Method and Description |
|---|---|
private static double |
algorithmBB(RandomGenerator random,
double a0,
double a,
double b)
Returns one sample using Cheng's BB algorithm, when both α and β are greater than 1.
|
private static double |
algorithmBC(RandomGenerator random,
double a0,
double a,
double b)
Returns one sample using Cheng's BC algorithm, when at least one of α and β is smaller than 1.
|
(package private) static double |
sample(RandomGenerator random,
double alpha,
double beta)
Returns one sample using Cheng's sampling algorithm.
|
static double sample(RandomGenerator random, double alpha, double beta)
random - random generator to usealpha - distribution first shape parameterbeta - distribution second shape parameterprivate static double algorithmBB(RandomGenerator random, double a0, double a, double b)
random - random generator to usea0 - distribution first shape parameter (α)a - min(α, β) where α, β are the two distribution shape parametersb - max(α, β) where α, β are the two distribution shape parametersprivate static double algorithmBC(RandomGenerator random, double a0, double a, double b)
random - random generator to usea0 - distribution first shape parameter (α)a - max(α, β) where α, β are the two distribution shape parametersb - min(α, β) where α, β are the two distribution shape parametersCopyright (c) 2003-2017 Apache Software Foundation