如何从 Java 中的伽马分布生成数字?
问问题
2514 次
2 回答
2
来自 Apache Commons GammaDistribution
-Math 包:
double sample = new GammaDistribution(shape, scale).sample();
于 2014-09-17T07:46:28.223 回答
1
Apache Commons Math 3.3 API 中有一种可能性
GammaDistribution(double shape, double scale)
// Creates a new gamma distribution with specified values of the shape and scale parameters.
GammaDistribution(double shape, double scale, double inverseCumAccuracy)
// Creates a new gamma distribution with specified values of the shape and scale parameters.
GammaDistribution(RandomGenerator rng, double shape, double scale)
// Creates a Gamma distribution.
GammaDistribution(RandomGenerator rng, double shape, double scale, double inverseCumAccuracy)
// Creates a Gamma distribution.
于 2014-09-17T07:48:52.323 回答