This is an automated email from the ASF dual-hosted git repository.
aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-rng.git
The following commit(s) were added to refs/heads/master by this push:
new ddecbc5 javadoc: Correct description of beta sampler and algorithmBC.
ddecbc5 is described below
commit ddecbc5838f0ce328b6c098bd572f0a52bf0a898
Author: Alex Herbert <[email protected]>
AuthorDate: Wed Oct 2 23:06:07 2019 +0100
javadoc: Correct description of beta sampler and algorithmBC.
---
.../rng/sampling/distribution/ChengBetaSampler.java | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git
a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/ChengBetaSampler.java
b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/ChengBetaSampler.java
index c85278a..f96e198 100644
---
a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/ChengBetaSampler.java
+++
b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/ChengBetaSampler.java
@@ -19,7 +19,9 @@ package org.apache.commons.rng.sampling.distribution;
import org.apache.commons.rng.UniformRandomProvider;
/**
- * Utility class implementing Cheng's algorithms for beta distribution
sampling.
+ * Sampling from a <a
href="http://en.wikipedia.org/wiki/Beta_distribution">Beta distribution</a>.
+ *
+ * <p>Uses Cheng's algorithms for beta distribution sampling:</p>
*
* <blockquote>
* <pre>
@@ -92,8 +94,8 @@ public class ChengBetaSampler
if (a > 1) {
return algorithmBB(a, b);
}
- // This method declares parameters (a, b).
- // The algorithm is deliberately invoked with reversed parameters.
+ // The algorithm is deliberately invoked with reversed parameters
+ // as the argument order is: max(alpha,beta), min(alpha,beta).
return algorithmBC(b, a);
}
@@ -150,11 +152,11 @@ public class ChengBetaSampler
}
/**
- * Computes one sample using Cheng's BB algorithm, when at least one of
+ * Computes one sample using Cheng's BC algorithm, when at least one of
* \( \alpha \) or \( \beta \) is smaller than 1.
*
- * @param a \( \min(\alpha, \beta) \).
- * @param b \( \max(\alpha, \beta) \).
+ * @param a \( \max(\alpha, \beta) \).
+ * @param b \( \min(\alpha, \beta) \).
* @return a random sample.
*/
private double algorithmBC(double a,