程序包 weka.core
类 RandomVariates
java.lang.Object
java.util.Random
weka.core.RandomVariates
- 所有已实现的接口:
Serializable
,RandomGenerator
,RevisionHandler
Class implementing some simple random variates generator.
- 版本:
- $Revision: 5360 $
- 作者:
- Xin Xu (xx5@cs.waikato.ac.nz)
- 另请参阅:
-
嵌套类概要
-
构造器概要
构造器构造器说明Simply the constructor of super classRandomVariates
(long seed) Simply the constructor of super class -
方法概要
修饰符和类型方法说明Returns the revision string.static void
Main method for testing this class.double
nextErlang
(int a) Generate a value of a variate following standard Erlang distribution.double
Generate a value of a variate following standard exponential distribution using simple inverse method.double
nextGamma
(double a) Generate a value of a variate following standard Gamma distribution with shape parameter a.从类继承的方法 java.util.Random
doubles, doubles, doubles, doubles, ints, ints, ints, ints, longs, longs, longs, longs, nextBoolean, nextBytes, nextDouble, nextFloat, nextGaussian, nextInt, nextInt, nextLong, setSeed
从接口继承的方法 java.util.random.RandomGenerator
isDeprecated, nextDouble, nextDouble, nextFloat, nextFloat, nextGaussian, nextInt, nextLong, nextLong
-
构造器详细资料
-
RandomVariates
public RandomVariates()Simply the constructor of super class -
RandomVariates
public RandomVariates(long seed) Simply the constructor of super class- 参数:
seed
- the seed in this random object
-
-
方法详细资料
-
nextExponential
public double nextExponential()Generate a value of a variate following standard exponential distribution using simple inverse method.Variates related to standard Exponential can be generated using simple transformations.
- 指定者:
nextExponential
在接口中RandomGenerator
- 返回:
- a value of the variate
-
nextErlang
Generate a value of a variate following standard Erlang distribution. It can be used when the shape parameter is an integer and not too large, say, <100. When the parameter is not an integer (which is often named Gamma distribution) or is large, usenextGamma(double a)
instead.- 参数:
a
- the shape parameter, must be no less than 1- 返回:
- a value of the variate
- 抛出:
Exception
- if parameter less than 1
-
nextGamma
Generate a value of a variate following standard Gamma distribution with shape parameter a.If a>1, it uses a rejection method developed by Minh(1988)"Generating Gamma Variates", ACM Trans. on Math. Software, Vol.14, No.3, pp261-266.
If a<1, it uses the algorithm "GS" developed by Ahrens and Dieter(1974) "COMPUTER METHODS FOR SAMPLING FROM GAMMA, BETA, POISSON AND BINOMIAL DISTRIBUTIONS", COMPUTING, 12 (1974), pp223-246, and further implemented in Fortran by Ahrens, Kohrt and Dieter(1983) "Algorithm 599: sampling from Gamma and Poisson distributions", ACM Trans. on Math. Software, Vol.9 No.2, pp255-257.Variates related to standard Gamma can be generated using simple transformations.
- 参数:
a
- the shape parameter, must be greater than 1- 返回:
- a value of the variate
- 抛出:
Exception
- if parameter not greater than 1
-
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 返回:
- the revision
-
main
Main method for testing this class.- 参数:
ops
- # of variates/seed, default is 10/45
-