Author: mikl Date: Fri Jun 8 10:47:59 2012 New Revision: 1348020 URL: http://svn.apache.org/viewvc?rev=1348020&view=rev Log: MATH-774: Fixed documentation to described the actual sampling algorithms used
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/GammaDistribution.java Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/GammaDistribution.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/GammaDistribution.java?rev=1348020&r1=1348019&r2=1348020&view=diff ============================================================================== --- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/GammaDistribution.java (original) +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/GammaDistribution.java Fri Jun 8 10:47:59 2012 @@ -343,7 +343,21 @@ public class GammaDistribution extends A return true; } - /** {@inheritDoc} */ + /** + * <p>This implementation uses the following algorithms: </p> + * + * <p>For 0 < shape < 1: <br/> + * Ahrens, J. H. and Dieter, U., <i>Computer methods for + * sampling from gamma, beta, Poisson and binomial distributions.</i> + * Computing, 12, 223-246, 1974.</p> + * + * <p>For shape >= 1: <br/> + * Marsaglia and Tsang, <i>A Simple Method for Generating + * Gamma Variables.</i> ACM Transactions on Mathematical Software, + * Volume 26 Issue 3, September, 2000.</p> + * + * @return random value sampled from the Gamma(shape, scale) distribution + */ @Override public double sample() { return randomData.nextGamma(shape, scale);